![]() |
VirtualStringTree - IncrementalSearch
Hallo!
Hat jemand von Euch eine Ahnung wie IncrementalSearch beim VirtualStringTree funktioniert. Hat vielleicht jemand einige Code-Schnippsel. Danke |
Re: VirtualStringTree - IncrementalSearch
Hallo,
wie das genau funtzt kann ich dir nicht sagen aber Du kannst Dir ja mal bei ![]() Diese liegt als PDF und HTML-Format vor. Wenn Du dir PDF herunterlädst, schau dir die Seite 383 an, da sollte Dir weitergeholfen werden. |
Re: VirtualStringTree - IncrementalSearch
easy...
IncrementalSearch := isAll; schon ist an. wenn du auf die suche genauer reagieren möchtest dann musst du das OnIncrementalSearch Ereignis erweitern. die onlinehilfe beschreibt das ganz gut, zusammengefasst funktioniert das wie eine normale suche. This event is integral part of the incremental search functionality (see also Keyboard, hotkeys and incremental search). It is triggered during search for a node which matches the given string. Similar to other compare routines return a value < 0 if the node's caption is considered as being before the given text, = 0 if it is the same and > 0 if it is considered being after the given text.
Delphi-Quellcode:
Notes
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; Usually incremental search allows to match also partially. Hence it is recommended to do comparison only up to the length of the shorter string. |
Re: VirtualStringTree - IncrementalSearch
Das Beispiel hab ich schon gefunden, aber ich versteh eigentlich das ganze Kapitel nicht, kann mir da jemand vielleicht mit einem eigenen Beispiel helfen??
Gruss Karl |
DP-Maintenance
Dieses Thema wurde von "Daniel" von "Datenbanken" nach "VCL-Komponenten und Controls" verschoben.
|
Re: VirtualStringTree - IncrementalSearch
im string wird übergeben was du eingegeben hast.
als ergebnis lieferst du (Result) ob der "node"-Wert größer, kleine oder gleich dem "text" ist. von node musst du eigendlich nur den wert ermitteln der genutzt werden soll. im normalfall ist das der text der in baum ausgegeben wird. wenn das immer noch nicht ausreichen sollte poste ich ein beispiel... |
Re: VirtualStringTree - IncrementalSearch
kannst du mir mal ein beispiel posten
Danke |
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:55 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