Print Page | Close Window

Improvement: simulated mouse click event

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=22375
Printed Date: 05 May 2024 at 3:56am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Improvement: simulated mouse click event
Posted By: Michl
Subject: Improvement: simulated mouse click event
Date Posted: 31 July 2014 at 4:33am
Hello

I/we use the feature to editing a cell via mouse double click.
In our particular case, the user must first authenticate before being allowed to proceed.
(this is done in event XTP_NM_REPORT_REQUESTEDIT)

This works fine. But after authentication, the following code is executed in CXTPReportRecordItem::OnDblClick:


CXTPReportInplaceEdit* pEdit = DYNAMIC_DOWNCAST(CXTPReportInplaceEdit, CWnd::FromHandle(WindowFromPoint(pt)));
if (pEdit && pEdit->GetItem() == this)
{
   CXTPReportRecordItemEditOptions* pEditOptions = GetEditOptions(pClickArgs->pColumn);

   if (pEditOptions->m_bSelectTextOnEdit)
      pEdit->SetSel(0, -1);
   else
      DoMouseButtonClick();
}


This line simulates a click event at the current mouse position. However, if the user shows a dialog before (for whatever reason), it must be borne in mind that mouse position is no longer located at the expected position.

I think the click event should fired at absolute mouse coordinates (coordinate of double click event of user)

Regards



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