Print Page | Close Window

ReportItemControl 'SetCapture' problem

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=15691
Printed Date: 29 September 2024 at 1:31pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ReportItemControl 'SetCapture' problem
Posted By: yayo
Subject: ReportItemControl 'SetCapture' problem
Date Posted: 22 November 2009 at 8:32pm
I found some faults in extreme toolkit codes.
I want for you to modify a message function as follows.
 
void CReportItemControlsDlg::OnItemButtonClick(NMHDR * pNotifyStruct, LRESULT*)
{
 XTP_NM_REPORTITEMCONTROL* pItemNotify = (XTP_NM_REPORTITEMCONTROL*) pNotifyStruct;
 if(!(pItemNotify->pRow && pItemNotify->pItem && pItemNotify->pItemControl))
  return;
 
 CTestDlg dlg;
 dlg.DoModal(); // CTestDlg doesn't work due to receiving a messeage in ReleaseCapture(). please refer to a modified code that I attached.
 
...
 
}
 
 
I recommand as follows:
 
BOOL CXTPReportRecordItem::OnLButtonUp(XTP_REPORTRECORDITEM_CLICKARGS* pClickArgs)
{
 if (m_pItemControlHookWnd && m_pFocusedItemControl)
 {
  pClickArgs->pControl->ScreenToClient(&pClickArgs->ptClient);
//   yayo write :
 // destroy item control window
  ReleaseCapture();

  m_pFocusedItemControl->OnLButtonUp(pClickArgs); // XTP_NM_REPORT_ITEMBUTTONCLICK 
  pClickArgs->pControl->RedrawControl();
  

// yayo
  // destroy item control window
  //ReleaseCapture();
  m_pItemControlHookWnd->DestroyWindow();
  delete m_pItemControlHookWnd;
  m_pItemControlHookWnd = NULL;
  return TRUE;
 }
 


-------------
hi



Replies:
Posted By: mdoubson
Date Posted: 22 November 2009 at 11:14pm
Can't confirm - try this:

void CReportItemControlsDlg::OnItemButtonClick(NMHDR * pNotifyStruct, LRESULT*) {

XTP_NM_REPORTITEMCONTROL* pItemNotify = (XTP_NM_REPORTITEMCONTROL*) pNotifyStruct;

if (!(pItemNotify->pRow && pItemNotify->pItem && pItemNotify->pItemControl)) return;

if (AfxMessageBox(_T("AfxMessageBox"), MB_OKCANCEL) != IDOK) return;

switch(pItemNotify->pItemControl->GetIndex()) ........................


-------------
Mark Doubson, Ph.D.



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