Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Improvement: simulated mouse click event
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Improvement: simulated mouse click event

 Post Reply Post Reply
Author
Message
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Topic: Improvement: simulated mouse click event
    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
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.156 seconds.