BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TListView, moving columns and item captions being written in

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Francois Charton
Guest





PostPosted: Thu Jul 24, 2003 3:25 pm    Post subject: TListView, moving columns and item captions being written in Reply with quote



Hello,

Yes, I'm having a bad day today...

Still with my TListView, moving columns around...

I have redefined the CustomDrawSubItems event handler as...

void __fastcall TMyListView::MyListViewCustomDrawSubItem(TCustomListView
*Sender,
TListItem *Item, int SubItem, TCustomDrawState State,
bool &DefaultDraw)
{
RECT R = {LVIR_BOUNDS, SubItem, 0, 0};
SNDMSG(MyListView->Handle, LVM_GETSUBITEMRECT,
Item->Index,reinterpret_cast<LPARAM>(&R));
InflateRect(&R, -1, -1);
String
S=FormatFloat("###,###,##0.#",StrToFloat(Item->SubItems->Strings[SubItem-1])
);
int pos=R.right-3-MyListView->Canvas->TextWidth(S);
MyListView->Canvas->TextRect(R,pos,R.top,S);
DefaultDraw=false;
}

so subitems are formatted before they are drawn. Item captions are handled
by the default drawing procedure.

Now, when I move the first column (ie the one which displays the captions)
to any position but the rightmost, all captions are drawn in bold. If I move
it back, the captions are drawn normally again.

If I remove the CustomDrawSubItem() function, the problem disappears.

Has anyone experienced such a problem? And do you know a workaround?

Thanks in advance
Francois


Back to top
Hugo Oliveira Dias
Guest





PostPosted: Thu Jul 24, 2003 5:48 pm    Post subject: Re: TListView, moving columns and item captions being writte Reply with quote



I'm having lots of problems to implement a Shell ListView in BCB6 update 4.

I think VCL as bugs in CustomDraw.

For example OnAdvancedCustomDrawItem(..) never receives PostPaint Stage.

Hugo Oliveira Dias

"Francois Charton" <f.charton (AT) libertysurf (DOT) fr> wrote

Quote:
Hello,

Yes, I'm having a bad day today...

Still with my TListView, moving columns around...

I have redefined the CustomDrawSubItems event handler as...

void __fastcall TMyListView::MyListViewCustomDrawSubItem(TCustomListView
*Sender,
TListItem *Item, int SubItem, TCustomDrawState State,
bool &DefaultDraw)
{
RECT R = {LVIR_BOUNDS, SubItem, 0, 0};
SNDMSG(MyListView->Handle, LVM_GETSUBITEMRECT,
Item->Index,reinterpret_cast<LPARAM>(&R));
InflateRect(&R, -1, -1);
String

S=FormatFloat("###,###,##0.#",StrToFloat(Item->SubItems->Strings[SubItem-1])
);
int pos=R.right-3-MyListView->Canvas->TextWidth(S);
MyListView->Canvas->TextRect(R,pos,R.top,S);
DefaultDraw=false;
}

so subitems are formatted before they are drawn. Item captions are handled
by the default drawing procedure.

Now, when I move the first column (ie the one which displays the captions)
to any position but the rightmost, all captions are drawn in bold. If I
move
it back, the captions are drawn normally again.

If I remove the CustomDrawSubItem() function, the problem disappears.

Has anyone experienced such a problem? And do you know a workaround?

Thanks in advance
Francois





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.