<br><br><div class="gmail_quote">2012/10/18 ik <span dir="ltr"><<a href="mailto:idokan@gmail.com" target="_blank">idokan@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I'm trying to figure out why this keep on existing on VT from CCR<br>
virtualtree-new .<br></blockquote><div><br><br>A new release is already done (just i could not upload to Lazarus-ccr) so maybe is already fixed.<br><br>Anyway you can send the complete project here so i can test<br><br>Luiz<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The problem is that it display only the first char instead of the whole string.<br>
<br>
My code:<br>
------------------<br>
....<br>
type<br>
PTreeData = ^TTreeData;<br>
TTreeData = record<br>
Column1,<br>
Column2,<br>
Column3 : String;<br>
end;<br>
<br>
<br>
procedure TForm1.FormCreate ( Sender : TObject ) ;<br>
var<br>
Column : TVirtualTreeColumn;<br>
i : integer;<br>
begin<br>
Randomize;<br>
VST.Header.Options := VST.Header.Options +[hoVisible];<br>
VST.Header.Style := hsFlatButtons;<br>
for i := 1 to 3 do<br>
begin<br>
Column := VST.Header.Columns.Add;<br>
Column.Text := 'column #' + IntToStr(i);<br>
Column.Options := Column.Options + [coAllowClick, coResizable];<br>
Column.Width := UTF8Length(Column.Text) + 100;<br>
end;<br>
<br>
VST.TreeOptions.MiscOptions := VST.TreeOptions.MiscOptions +<br>
[toEditable,toGridExtensions];<br>
VST.TreeOptions.SelectionOptions := VST.TreeOptions.SelectionOptions +<br>
[toExtendedFocus, toMultiSelect];<br>
<br>
end;<br>
<br>
procedure TForm1.btnAddRootClick ( Sender : TObject ) ;<br>
Var<br>
Data : PTreeData;<br>
XNode : PVirtualNode;<br>
Rand : Integer;<br>
begin<br>
Rand := Random(99);<br>
XNode := VST.AddChild(nil);<br>
<br>
if VST.AbsoluteIndex(XNode) > -1 then<br>
Begin<br>
Data := VST.GetNodeData(XNode);<br>
Data^.Column1 := 'One ' + IntToStr(Rand);<br>
Data^.Column2 := 'Two ' + IntToStr(Rand + 10);<br>
Data^.Column3 := 'Three ' + IntToStr(Rand - 5);<br>
End;<br>
<br>
end;<br>
<br>
procedure TForm1.VSTChange ( Sender : TBaseVirtualTree; Node : PVirtualNode ) ;<br>
begin<br>
VST.Refresh;<br>
end;<br>
<br>
procedure TForm1.VSTFocusChanged ( Sender : TBaseVirtualTree;<br>
Node : PVirtualNode; Column : TColumnIndex ) ;<br>
begin<br>
VST.Refresh;<br>
end;<br>
<br>
procedure TForm1.VSTGetNodeDataSize ( Sender : TBaseVirtualTree;<br>
var NodeDataSize : Integer ) ;<br>
begin<br>
NodeDataSize := SizeOf(TTreeData);<br>
end;<br>
<br>
procedure TForm1.VSTGetText ( Sender : TBaseVirtualTree; Node : PVirtualNode;<br>
Column : TColumnIndex; TextType : TVSTTextType; var CellText : WideString ) ;<br>
var<br>
Data : PTreeData;<br>
begin<br>
Data := VST.GetNodeData(Node);<br>
case Column of<br>
0 : CellText := Data^.Column1;<br>
1 : CellText := Data^.Column2;<br>
2 : CellText := Data^.Column3;<br>
end;<br>
end;<br>
<br>
procedure TForm1.VSTNewText ( Sender : TBaseVirtualTree; Node : PVirtualNode;<br>
Column : TColumnIndex; NewText : WideString ) ;<br>
var<br>
Data : PTreeData;<br>
begin<br>
Data := VST.GetNodeData(Node);<br>
case Column of<br>
0 : Data^.Column1 := NewText;<br>
1 : Data^.Column2 := NewText;<br>
2 : Data^.Column3 := NewText;<br>
end;<br>
end;<br>
<br>
...<br>
<br>
-------------------------<br>
Any ideas why it happens and how to solve this ?<br>
<br>
Thanks,<br>
Ido<br>
<br>--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
<br></blockquote></div><br>