<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-NZ link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='color:#1F497D'>Thanks for that. I think I
get it now. If I define 5 columns in the Columns property then the
component will call the OnGetText event 5 times for each line (node).<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>I just have to work out what </span><span
style='font-size:11.0pt;color:black'>NodeData := Sender.GetNodeData(Node)</span><span
style='color:#1F497D'> does but there are examples for this so I should be
right, thanks.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>Ross.<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> delphi-bounces@delphi.org.nz
[mailto:delphi-bounces@delphi.org.nz] <b>On Behalf Of </b>Conor Boyd<br>
<b>Sent:</b> Monday, 12 November 2007 4:06 p.m.<br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> RE: [DUG] Soft-Gems Virtual TreeView for a ListView<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>The Header property of TVirtualStringTree has a Columns
property. Specify your columns in there.</span><span style='font-family:
"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Then the OnGetText event has a Column parameter.</span><span
style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>So you can do something like this in your OnGetText event handler:</span><span
style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>procedure TFileSelectionDialog.vstFilesGetText(Sender:
TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType:
TVSTTextType;<br>
var CellText: WideString);<br>
var<br>
NodeData : PTreeViewNodeData;<br>
begin<br>
NodeData := Sender.GetNodeData(Node);</span><span style='font-family:
"Times New Roman","serif"'><o:p></o:p></span></p>
<div>
<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'> CellText := '';</span><span style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<div>
<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'> case Column of<br>
0: CellText := ExtractFileName(NodeData.Filename);<br>
1: begin<br>
if not NodeData.IsFolder
then<br>
CellText :=
DateTimeToStr(NodeData.FileDate);<br>
end;<br>
end;<br>
end;</span><span style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>This is from when I wrote our own file selection dialog, since the built-in Delphi one can't cope with more than a certain number of files</span><span
style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>(if you're interested in the specifics, IIRC
the number of files the built-in
one can cope with is limited to the number of fully qualified
paths which will fit into 32000 bytes or something - it's a problem with
the underlying WinAPI).</span><span style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Hopefully that's enough to get you going. Ask away if you've
got more questions.</span><span style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>HTH,</span><span style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'> <o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>Conor</span><span style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
<div>
<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'><o:p> </o:p></span></p>
</div>
<div class=MsoNormal align=center style='text-align:center'><span lang=EN-US
style='font-family:"Times New Roman","serif"'>
<hr size=3 width="100%" align=center>
</span></div>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> delphi-bounces@delphi.org.nz
[mailto:delphi-bounces@delphi.org.nz] <b>On Behalf Of </b>Ross Levis<br>
</span><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'> </span><span lang=EN-US style='font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-family:"Times New Roman","serif"'>I
think someone mention they were using Virtual TreeView recently. I heard
that it can be made to look like a standard ListView, so I’m
investigating it to replace a TListView in an app of mine which takes far too
long to load up to 20,000 items.<o:p></o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I can’t use TListView in virtual mode as it seems way
too difficult to enable sorting on columns which I need. The Virtual
TreeView appears to handle sorting as easy as TListView does in non-virtual
mode.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I’m just having difficultly working out how the use
the component! I realize I need to set up a record for each set of data
but I can’t work out how to add columns of data. The examples are
mostly involved with tree structures.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I’m hoping someone can quote for me a basic piece of
code for adding say 2 items with 2 or 3 columns.<o:p></o:p></p>
</div>
</body>
</html>