2014-03-13 15:56 GMT+01:00 Jim Leonard <trix...@oldskool.org>: > On 3/13/2014 9:49 AM, Jim Leonard wrote: > >> On 3/12/2014 6:58 PM, Philippe wrote: >> >>> you could >>> >>> - store the actual collection to a TMemoryStream, >>> >>> - destroy the collection, >>> >>> - Load then a new collect to be sort with different method ... >>> >> >> Yes, that's what I'm doing now for every re-sort. >> > > Actually, sorry, that's not *exactly* what I'm doing -- I'm creating a new > TSortedCollection, using ForEach to iterate through the old collection to > Insert into the new one, and then destroying the old one. This copies only > pointers (and runs through the Compare method) and is actually pretty fast > -- it's just not elegant. > > If I stored the entire thing to a memory stream, it would copy all of the > data and every re-sort would go pretty slowly.
You are sorting only for display purposes? If so, maybe VirtualTreeView could do the trick. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal