> Message: 6
> Date: Thu, 17 Mar 2005 09:35:37 +0200
> From: Simeon Mitev <[EMAIL PROTECTED]>
> Subject: Re: replace sort method in TListView
> To: "Borland's Delphi Discussion List" <[email protected]>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> no , the CLX component does not have such features. That's why i am
> asking! :)
> it seams i have to write all those methods by my self.
>
> Rob Kennedy wrote:
>
> > Simeon Mitev wrote:
> >
> >> Is it possible to replace the sort method for a TListView component?
> >> I am working on CLX project.

Straight out of the help file is:

Delphi syntax:

procedure Sort(Compare: TListSortCompare);

C++ syntax:

void __fastcall Sort(TListSortCompare Compare);

Description

Call Sort to sort the items in the Items array. Compare is a comparison
function that indicates how the items are to be ordered.

Define your own sort routine and then call
MyList.Sort(MySortRoutine)


function MySortRoutine(Item1, Item2 : pointer) : integer;
returns >0 if Item1 > Item2
        <0 if Item2 > Item1
        0  if Item1 = Item2


I use them constantly

Mick


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to