Changing font in TListView::OnCustomDrawItem


2005-02-11 06:47:03 PM
cppbuilder7
We have just found that changing the font style in OnCustomDrawItem
causes problems with the selection rectangle in large icon view. The
problem is that the new style can cause the caption to wrap but the
selection rectangle doesn't accomodate the new size.
Do I have to move the code to the OnAdvancedCustomDrawItem handler?
FWIW the current handler is below:
void __fastcall TFrmSectorViewer::lvwFileViewCustomDrawItem(
TCustomListView *Sender, TListItem *Item, TCustomDrawState State,
bool &DefaultDraw)
{
TGeneral_ObjectList * dataInfo=
reinterpret_cast<TGeneral_ObjectList>( Item->Data );
if( !dataInfo->GenTreeInfo.IsColouredF )
return;
TListView * listView=getActiveListView();
listView->Canvas->Font->Color=dataInfo->GenTreeInfo.Colour;
listView->Canvas->Font->Style=
ViewerUtils_FontStyle( dataInfo->GenTreeInfo.FontStyle );
}
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html