Print Page | Close Window

Getting CXTPReportRecordItem coordinates

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=19456
Printed Date: 14 June 2025 at 10:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Getting CXTPReportRecordItem coordinates
Posted By: Vincs
Subject: Getting CXTPReportRecordItem coordinates
Date Posted: 01 February 2012 at 9:39am
Hello everyone!


I’m beginning to work with CodeJock.

I’m software engineer and I’m in charge of software automation (simulate user action on GUI).

I’m trying to implement automation on CodeJock component: get the coordinates, text caption…

So far, I can get the caption of the CXTPReportRecordItem controls.


What I’m trying to do now is to retrieve the coordinates of that component.

 

I’m trying to use the “ virtual void (XTP_REPORTRECORDITEM_ARGS* pDrawArgs, CRect& rcItem);   function, but I can’t make it works and I don’t find any explanation on the web.

 
I’ve got a loop that browses my records, and when it finds the good one, it tries to retrieve the coordinates:
 

        CRect ret;

        CXTPReportRecordItem *pItem = pReportRecord->GetItem(0);

       

        XTP_REPORTRECORDITEM_ARGS drawArgs;

        drawArgs.pControl = pReportCtrl;       

        drawArgs.pItem = pItem;

 

        pItem->GetCaptionRect(&drawArgs,ret);

 

But this function returns incoherent data. It returns {top=0 bottom=0 left=17 right=0} for each row that has an icon in front of it, and tagRECT = {top=0 bottom=0 left=0 right=0} where there is no icon.


Can you help me on this one ?



-------------
Product: Xtreme ToolkitPro 2011 (15.1.2)
Platform: Windows 7 x64
Language: C++ MFC



Replies:
Posted By: Vincs
Date Posted: 09 February 2012 at 4:02am

Hello!
I've done the same job on the TaskPanel and it works pretty well.

I’ve used the methods: ret = pTaskPanelItem->GetInvalidateRect(); and ret = pTaskPanelItem->GetTextRect();

 

Still no idea how I can do the same with ReportControl component?



-------------
Product: Xtreme ToolkitPro 2011 (15.1.2)
Platform: Windows 7 x64
Language: C++ MFC


Posted By: Vincs
Date Posted: 16 February 2012 at 5:20am

They replied to my ticket:

“Hello,

you can not retrieve the coordinates of an item, you need to calculate them. You need to do the following:

1) Get the screenrows
CXTPReportScreenRows *pScreenRows = m_wndReport.GetSections()->GetAt(1)->GetRows()->GetScreenRows();

2) Find the item row in the screen rows
pScreenRows is a CArray, loop through the array to find pItem->CXTPReportRecord()

3) You then need to intersect the row rectangle with the column rectangle (pColumn->GetRect())

Andre

 

I didn’t try it yet.

 

 



-------------
Product: Xtreme ToolkitPro 2011 (15.1.2)
Platform: Windows 7 x64
Language: C++ MFC



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