Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Getting CXTPReportRecordItem coordinates
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Getting CXTPReportRecordItem coordinates

 Post Reply Post Reply
Author
Message
Vincs View Drop Down
Newbie
Newbie
Avatar

Joined: 01 February 2012
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vincs Quote  Post ReplyReply Direct Link To This Post Topic: Getting CXTPReportRecordItem coordinates
    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
Back to Top
Vincs View Drop Down
Newbie
Newbie
Avatar

Joined: 01 February 2012
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vincs Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Vincs View Drop Down
Newbie
Newbie
Avatar

Joined: 01 February 2012
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vincs Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.