<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.&nbsp; I think I
get it now.&nbsp; 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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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.&nbsp; 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"'>&nbsp;<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"'>&nbsp;<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"'>&nbsp;<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>
&nbsp; var CellText: WideString);<br>
var<br>
&nbsp; NodeData : PTreeViewNodeData;<br>
begin<br>
&nbsp; 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"'>&nbsp;<o:p></o:p></span></p>

</div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>&nbsp; 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"'>&nbsp;<o:p></o:p></span></p>

</div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:blue'>&nbsp; case Column of<br>
&nbsp;&nbsp;&nbsp; 0:&nbsp; CellText := ExtractFileName(NodeData.Filename);<br>
&nbsp;&nbsp;&nbsp; 1:&nbsp; begin<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if not NodeData.IsFolder
then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CellText :=
DateTimeToStr(NodeData.FileDate);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;<br>
&nbsp; 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&nbsp;wrote&nbsp;our&nbsp;own&nbsp;file&nbsp;selection&nbsp;dialog,&nbsp;since&nbsp;the&nbsp;built-in&nbsp;Delphi&nbsp;one&nbsp;can't&nbsp;cope&nbsp;with&nbsp;more&nbsp;than&nbsp;a&nbsp;certain&nbsp;number&nbsp;of&nbsp;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&nbsp;you're&nbsp;interested&nbsp;in&nbsp;the&nbsp;specifics,&nbsp;IIRC
the&nbsp;number&nbsp;of&nbsp;files&nbsp;the built-in
one&nbsp;can&nbsp;cope&nbsp;with&nbsp;is&nbsp;limited&nbsp;to&nbsp;the&nbsp;number&nbsp;of&nbsp;fully&nbsp;qualified
paths which will fit into 32000&nbsp;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"'>&nbsp;<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.&nbsp; 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"'>&nbsp;<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"'>&nbsp;<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>&nbsp;</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'>&nbsp;</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.&nbsp; I heard
that it can be made to look like a standard ListView, so I&#8217;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>&nbsp;</o:p></p>

<p class=MsoNormal>I can&#8217;t use TListView in virtual mode as it seems way
too difficult to enable sorting on columns which I need.&nbsp; 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>&nbsp;</o:p></p>

<p class=MsoNormal>I&#8217;m just having difficultly working out how the use
the component!&nbsp; I realize I need to set up a record for each set of data
but I can&#8217;t work out how to add columns of data.&nbsp; The examples are
mostly involved with tree structures.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I&#8217;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>