Print Page | Close Window

[SOLVED] Right click coordinates not consistent

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=18963
Printed Date: 20 April 2024 at 8:57am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Right click coordinates not consistent
Posted By: Aaron Koolen
Subject: [SOLVED] Right click coordinates not consistent
Date Posted: 18 September 2011 at 8:48pm
With the upgrade to 15.1.3 we have noticed that the coordinates in the XTP_NM_REPORTRECORDITEM passed into the right click handler are not consistent between clicking on a row and in the empty area of the control.

In the latter it looks like coordinates are not translated to screen coordinates, and in the former they are (As they were in older versions).

Popup menus that are displayed on right click now appear in different positions depending on where you click.

Is there any known fix for this?

Thanks
Aaron



-------------
Product: Xtreme ToolkitPro v13.3.0 (MFC)
Platform: Windows XP (32bit) - SP 3
Language: Visual C++ 6



Replies:
Posted By: adrien
Date Posted: 18 September 2011 at 11:36pm
looks like a ClientToScreen is missing at line 3528 in XTPReportControl.cpp

it should be

// Context menu
if (pBehavior->bContextMenu)
{
if (NULL != m_pSections->HitTest(point))
{
if (NULL != clickArgs.pRow)
{
clickArgs.pRow->OnContextMenu(point);
}
else
{
ClientToScreen(&point);
SendMessageToParent(NULL, NULL, NULL, NM_RCLICK, &point);
}
}
}


-------------
http://www.wingate.com - http://www.wingate.com


Posted By: ABuenger
Date Posted: 20 September 2011 at 11:54pm
Thanks, it's indeed a bug. I've added a new test to the ReportSample.

Andre



-------------
Codejock support


Posted By: ABuenger
Date Posted: 21 September 2011 at 6:03pm
This has been fixed for the next release. As a workaround you can add the following code to your handler.

#if _XTPLIB_VERSION_PREFIX==1513

XTP_NM_REPORTRECORDITEM *pItemNotify = reinterpret_cast<XTP_NM_REPORTRECORDITEM*>(pNotifyStruct);

if (NULL == pItemNotify->pRow)
{
   m_wndReportControl.ClientToScreen(&pItemNotify->pt);
}

#endif



-------------
Codejock support



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