Print Page | Close Window

[solved] hit test in TreeMode of ReportControl

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


Topic: [solved] hit test in TreeMode of ReportControl
Posted By: cluster
Subject: [solved] hit test in TreeMode of ReportControl
Date Posted: 17 March 2018 at 8:50am
Hi,

there is a strange behavior on the expanding of a reportrecord.
It depends on which theme you have selected. On the default theme it works well but on the theme which is based on CXTPReportThemeOffice2013 it will expand if you click anywhere on the item.
I have figured out the reason, the rcBitmap will be limit by the DrawCollapsedBitmap function on default theme but not in the other theme.

...
CSize CXTPReportPaintManager::DrawCollapsedBitmap(CDC* pDC, const CXTPReportRow* pRow, CRect& rcBitmap)
{
	// Draw Standard image from resource.
	rcBitmap.left += XTP_DPI_X(2);
	CSize sizeGlyph = DrawGlyph(pDC, rcBitmap, pRow->IsExpanded() ? 0 : 1);
 
	if (sizeGlyph.cx != 0 && pDC != NULL)
		rcBitmap.right = rcBitmap.left + sizeGlyph.cx;

The CXTPReportThemeOffice2013::DrawCollapsedBitmap function leave the rcBitmap untouched.
Regards


-------------
Windows 7
Visual Studio 2013
CodeJock 18.6



Replies:
Posted By: cluster
Date Posted: 25 March 2018 at 6:29am
Hi support team,

could you confirm this issue?


-------------
Windows 7
Visual Studio 2013
CodeJock 18.6


Posted By: olebed
Date Posted: 29 March 2018 at 5:12pm
Hello Cluster,

Thank you for bringing this to our attention. I have fixed this with code below
CSize CXTPReportThemeOffice2013::DrawCollapsedBitmap(CDC* pDC, const CXTPReportRow* pRow, CRect& rcBitmap)
{
    CSize szGlyphPlace(XTP_DPI_X(15), XTP_DPI_Y(15));

    if (pDC)
    {
        CSize szGlyph(XTP_DPI_X(5), XTP_DPI_Y(8));
        rcBitmap.right = rcBitmap.left + szGlyphPlace.cx;

        CPoint ptGlyph = rcBitmap.CenterPoint();
        ptGlyph.x -= szGlyph.cx / 2;
        ptGlyph.y -= szGlyph.cy / 2;

        if (pRow->IsExpanded())
        {
            XTPDrawHelpers()->DrawExpandTriangle(pDC, ptGlyph, TRUE,
                m_clrGlyphContract);
        }
        else
        {
            XTPDrawHelpers()->DrawExpandTriangle(pDC, ptGlyph, FALSE,
                m_clrGlyphBorder, m_clrGlyphExpand);
        }
    }

    return szGlyphPlace;
}

Here also fixed non-centered by vertical expand/collapse glyph.

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