Print Page | Close Window

SetBold-Property in CXTPReportRecordItemPreview

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=17028
Printed Date: 29 September 2024 at 7:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SetBold-Property in CXTPReportRecordItemPreview
Posted By: Michl
Subject: SetBold-Property in CXTPReportRecordItemPreview
Date Posted: 29 July 2010 at 7:36am
Hi codejock developers!

If I use (set) this property, nothing happens. Any text in preview is still displayed in regluar style.

I saw, this property is derived from CXTPReportRecordItem. This class take notice the flag (see code)

void CXTPReportRecordItem::GetItemMetrics(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics)
{
    if (m_clrBackground != XTP_REPORT_COLOR_DEFAULT)
        pItemMetrics->clrBackground = m_clrBackground;

    if (m_clrText != XTP_REPORT_COLOR_DEFAULT)
        pItemMetrics->clrForeground = m_clrText;

    if (m_pFontCaption != NULL)
        pItemMetrics->pFont = m_pFontCaption;
    else if (m_bBoldText)
        pItemMetrics->pFont = &pDrawArgs->pControl->GetPaintManager()->m_fontBoldText;

    if (m_Alignment != (XTPReportColumnIconAlignment)(-1))
        pItemMetrics->nColumnAlignment = m_Alignment;
}



But class CXTPReportRecordItemPreview only take a default font.



void CXTPReportRecordItemPreview::GetItemMetrics(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics)
{
    pItemMetrics->clrForeground = pDrawArgs->pControl->GetPaintManager()->m_clrPreviewText;
    pItemMetrics->pFont = &pDrawArgs->pControl->GetPaintManager()->m_fontPreview;
}


Should this method not implemented as following (or similar)?


void CXTPReportRecordItemPreview::GetItemMetrics(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics)
{
    __super::GetItemMetrics( pDrawArgs, pItemMetrics );

    pItemMetrics->clrForeground = pDrawArgs->pControl->GetPaintManager()->m_clrPreviewText;
    if (!m_bBoldText)
        pItemMetrics->pFont = &pDrawArgs->pControl->GetPaintManager()->m_fontPreview;
}


I'm interesting for your response!

Michael



Replies:
Posted By: Michl
Date Posted: 11 August 2010 at 2:53am
Is this an issue for the next release?



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