Print Page | Close Window

ReportControl Default Font

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=22798
Printed Date: 05 May 2024 at 6:48am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ReportControl Default Font
Posted By: evamation
Subject: ReportControl Default Font
Date Posted: 25 November 2015 at 6:29am
Hello.
I want to know ReportControl's default font information.
for example, if we add item CXTPReportRecordItemText, we can see the text having some font attribute.

How can I get the font information?



Replies:
Posted By: olebed
Date Posted: 02 December 2015 at 8:51am
Hello,
See using  XTP_REPORTRECORDITEM_METRICS::pFont  in  CXTPReportRow::GetItemMetrics
pItemMetrics->pFont            = &pPaintManager->m_fontText;
CXTPReportPaintManager::GetTextFont() the same

then in  CXTPReportRow::GetItemMetrics -> CXTPReportRecordItem::GetItemMetrics
pDrawArgs->pItem->GetItemMetrics(pDrawArgs, pItemMetrics);
pItemMetrics->pFont  can be changed to custom font from CXTPReportRecordItem::GetFont 

so you can use next code to get font of ReportRecordItemText
CFont* SomeClass::GetFont(CXTPReportRecordItemText* pItem)
{
if (pItem)
{
if(pItem->GetFont())
return pItem->GetFont();
else if (pItem->IsBold())
return GetReportControl->GetPaintManager()->m_fontBoldText;
else
return GetReportControl->GetPaintManager()->GetTextFont();
}
return NULL;
}

Also note that item's font can be changed on fly when XTP_NM_REPORT_GETITEMMETRICS notification is handled.

Regards,
 Oleksandr Lebed



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net