 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Francois Charton Guest
|
Posted: Thu Jul 24, 2003 3:25 pm Post subject: TListView, moving columns and item captions being written in |
|
|
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
|
Posted: Thu Jul 24, 2003 5:48 pm Post subject: Re: TListView, moving columns and item captions being writte |
|
|
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 |
|
 |
|
|
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
|
|