2
votes

I can't understand the process described in documentation. It says to use event:

procedure TForm1.VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
                Column: Integer; TextType: TVSTTextType; var CellText: WideString);
var
    Data: PTreeData;
begin
   Data:=VST.GetNodeData(Node);
   CellText := Data^.FCaption;
end;

How do I do that? I can't redeclare it just like this. When I double click on Tree List OnGetTextEvent it throws some exception at me "Property and Method are incompatible"

2
Please tell us the exact message. Don't make us guess. - David Heffernan
Well, if i'm not mistaken, GetText is called for drawing the Nodes. But you said the exception is trows when you double click. Do you have some code on your DobleClick event? - Christopher Ramírez

2 Answers

3
votes

You don't mention the Delphi and VirtualTreeview version but I guess thats because of the CellText: WideString parameter - it should be of string type now after the UnicodeString became the default string type in Delphi. IOW change it to

procedure TForm1.VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
          Column: Integer; TextType: TVSTTextType; var CellText: string);
0
votes

There was something wrong with my project. I'm not sure what, cos I've recreated it. Now the GetText event works properly. My code above works.