Print Page | Close Window

Possible BUG in CXTPReportRow::GetItemMetrics

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=15192
Printed Date: 28 April 2024 at 6:19pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Possible BUG in CXTPReportRow::GetItemMetrics
Posted By: mgampi
Subject: Possible BUG in CXTPReportRow::GetItemMetrics
Date Posted: 16 September 2009 at 4:05pm
Hi;

I used to dynamically set icon alignment in report rows by providing it in my own CXTPReportRecord derived GetItemMetrics() function but I never got it to work. After a few minutes of debugging I found this in CXTPReportRow::GetItemMetrics
void CXTPReportRow::GetItemMetrics(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics)
{
    ASSERT(m_pRecord);
    ASSERT(pDrawArgs->pRow == this);
    ASSERT(pDrawArgs->pItem != NULL);
    if (!m_pRecord || !pDrawArgs->pItem)
        return;

    CXTPReportPaintManager* pPaintManager = pDrawArgs->pControl->GetPaintManager();

    pItemMetrics->pFont = &pPaintManager->m_fontText;
    pItemMetrics->clrForeground = pPaintManager->m_clrWindowText;
    pItemMetrics->clrBackground = XTP_REPORT_COLOR_DEFAULT;
    pItemMetrics->nColumnAlignment = pDrawArgs->nTextAlign;
    pItemMetrics->nItemIcon = XTP_REPORT_NOICON;

    m_pRecord->GetItemMetrics(pDrawArgs, pItemMetrics);      <-- Here I set my own alignment...
    pDrawArgs->pItem->GetItemMetrics(pDrawArgs, pItemMetrics);

    m_pControl->GetItemMetrics(pDrawArgs, pItemMetrics);
    pDrawArgs->nTextAlign = pItemMetrics->nColumnAlignment;   <-- ... and here everything is reset!
   ...


So, settings applied in my CXTPReportRecord derived class' GetItemMetrics are alwys overwritten!


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



Replies:
Posted By: mdoubson
Date Posted: 16 September 2009 at 5:01pm
What's happened if you comment this (red) line?

-------------
Mark Doubson, Ph.D.


Posted By: mgampi
Date Posted: 16 September 2009 at 5:58pm
I'll try it and will reply tomorrow!


-------------
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



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