By the way, I could use a hand figuring this Listview sort problem out.
From: Rod (fengist_at_earthlink.net)
Date: 02/18/05
- Next message: Raptor: "Re: How to increment a string?"
- Previous message: Rod: "Re: No, no specific problems now, just venting at another massive Borland (YEA I SAID BORLAND) absurdity."
- Next in thread: Raptor: "Re: By the way, I could use a hand figuring this Listview sort problemout."
- Reply: Raptor: "Re: By the way, I could use a hand figuring this Listview sort problemout."
- Reply: Maarten Wiltink: "Re: By the way, I could use a hand figuring this Listview sort problem out."
- Reply: alanglloyd_at_aol.com: "Re: By the way, I could use a hand figuring this Listview sort problem out."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Feb 2005 01:28:07 GMT
Have a listview. Some Subitem[2] entries need an icon, some don't.
It's just an icon, no text required. Text however is used to determine
whether to put an icon there when the subitem is added. '4'=Yes '1'=No.
Using the following, I'll be sorting the text based columns. Notice, I
have reverse sort temporarily disabled till I put in my boolean decision
maker.
procedure TForm1.MyviewCompare(Sender: TObject; Item1,
Item2: TListItem; Data: Integer; var Compare: Integer);
var
n1, n2: string;
begin
n1 := Item1.SubItems[2];
n2 := Item2.SubItems[2];
// if n1 > n2 then
// Compare := -1
// else if n1 < n2 then
// Compare := 1
// else
// Compare := 0;
if n1 < n2 then
Compare:=-1
else if n1 > n2 then
Compare :=1
else
compare:=0;
end;
My question is, how can I sort that column with just icons when there's
no text.
By the way, I've already tried the silly thing of throwing in the 1's
and 4's and using customdrawsubitem to change the font color to the
background color. Works fine till you click on it and a big stinking
number shines trhough the blue highlight bar.
- Next message: Raptor: "Re: How to increment a string?"
- Previous message: Rod: "Re: No, no specific problems now, just venting at another massive Borland (YEA I SAID BORLAND) absurdity."
- Next in thread: Raptor: "Re: By the way, I could use a hand figuring this Listview sort problemout."
- Reply: Raptor: "Re: By the way, I could use a hand figuring this Listview sort problemout."
- Reply: Maarten Wiltink: "Re: By the way, I could use a hand figuring this Listview sort problem out."
- Reply: alanglloyd_at_aol.com: "Re: By the way, I could use a hand figuring this Listview sort problem out."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|