![]() |
VST / IncrementalSearch
Hallo,
Irgendwie komme ich mit der IncrementalSearch des VST nicht weiter. Die Daten bekommt der VST aus einer Datenbank. IncrementalSearch steht auf isAll. Folgendes Beispiel aus den Advaned Demos von M.Lischke habe ich mir auch schon angesehen, komme damit aber auch nicht weiter, weil die Daten dort voher definiert werden und nicht aus einer DB kommen.
Delphi-Quellcode:
Was muß ich nun anstelle von 'PropText' und 'Result' einsetzen?
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 comparison routine which I did not want to link here for // size and clarity reasons. For now strings are (implicitly) converted to ANSI to make the comparison 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; Gruß U. |
Re: VST / IncrementalSearch
Hallo,
habe die Lösung gefunden.
Delphi-Quellcode:
Gruß U.
procedure TSTF.VST2IncrementalSearch(Sender: TBaseVirtualTree;
Node: PVirtualNode; const SearchText: WideString; var Result: Integer); var s1, s2: string; Data: PTreeData; begin Data:= VST2.GetNodeData(Node); s1 := SearchText; s2:= TTreeDataClass(Data.FObject).FName; Result := StrLIComp(PChar(s1), PChar(s2), Min(Length(s1), Length(s2))); end; |
Re: VST / IncrementalSearch
hättest du hier mal dp gesucht dann hättest du sogar was VOR deinem post gefunden.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:29 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz