Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [solved] hit test in TreeMode of ReportControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] hit test in TreeMode of ReportControl

 Post Reply Post Reply
Author
Message
cluster View Drop Down
Groupie
Groupie


Joined: 22 January 2015
Status: Offline
Points: 64
Post Options Post Options   Thanks (1) Thanks(1)   Quote cluster Quote  Post ReplyReply Direct Link To This Post Topic: [solved] hit test in TreeMode of ReportControl
    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 2010
CodeJock 18.2
Back to Top
cluster View Drop Down
Groupie
Groupie


Joined: 22 January 2015
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote cluster Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2018 at 6:29am
Hi support team,

could you confirm this issue?
Windows 7
Visual Studio 2010
CodeJock 18.2
Back to Top
olebed View Drop Down
Admin Group
Admin Group
Avatar

Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.086 seconds.