Print Page | Close Window

Series Picking

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18613
Printed Date: 04 December 2024 at 2:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Series Picking
Posted By: lrenoux
Subject: Series Picking
Date Posted: 04 July 2011 at 9:22am
Hello,
 
Is it possible to retrieve series on mouse over or on left button down ?
Thx in advance.
 
L.
 



Replies:
Posted By: lrenoux
Date Posted: 07 July 2011 at 5:05am

class ITChartControl : public CXTPChartControl
{
protected :
 DECLARE_MESSAGE_MAP()
 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
};

typedef struct
{
 NMHDR   hdr;            // NMHDR structure that contains additional information about this notification.
 ITChartControl* pControl;  // Pointer to control that caused the event.
 UINT   nFlags;
 CPoint   point;
}
NMHDRCHARTCONTROL, FAR* LPNMHDRCHARTCONTROL;

 

BEGIN_MESSAGE_MAP(ITChartControl, CXTPChartControl)
 ON_WM_LBUTTONDBLCLK()
 ON_WM_RBUTTONUP()
 ON_WM_MOUSEWHEEL()
END_MESSAGE_MAP()

BOOL ITChartControl::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
 return CXTPChartControl::OnMouseWheel(nFlags, -zDelta, pt);  // Inverse Zoom !
}

void ITChartControl::OnLButtonDblClk(UINT nFlags, CPoint point)
{
 CXTPChartControl::OnLButtonDblClk(nFlags, point);

 NMHDRCHARTCONTROL notify;
 notify.hdr.hwndFrom = m_hWnd;
 notify.hdr.code = NM_DBLCLK;
 notify.hdr.idFrom = GetDlgCtrlID();
 notify.nFlags = nFlags;
 notify.point = point;
 notify.pControl = this;

 GetOwner()->SendMessage(WM_NOTIFY, (WPARAM)notify.hdr.idFrom, (LPARAM)&notify);
}

void ITChartControl::OnRButtonUp(UINT nFlags, CPoint point)
{
 CXTPChartControl::OnRButtonUp(nFlags, point);

 NMHDRCHARTCONTROL notify;
 notify.hdr.hwndFrom = m_hWnd;
 notify.hdr.code = NM_RCLICK;
 notify.hdr.idFrom = GetDlgCtrlID();
 notify.nFlags = nFlags;
 notify.point = point;
 notify.pControl = this;

 GetOwner()->SendMessage(WM_NOTIFY, (WPARAM)notify.hdr.idFrom, (LPARAM)&notify);
}


...
// Handling message in view containing chart control


BOOL ITChartView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
 NMHDR* pnmhdr = (NMHDR*)lParam;

 if (pnmhdr && pnmhdr->code == NM_DBLCLK)
 {
  NMHDRCHARTCONTROL *pnmhdrEx = (NMHDRCHARTCONTROL *) pnmhdr;

  CXTPChartElement* hit = m_wndChartControl.HitTest(pnmhdrEx->point);

  if (hit)
  {
   // Bla bla
  }
  
 }
 

 return CXTPResizeFormView::OnNotify(wParam, lParam, pResult);
}

Thx for poor documentation, poor sample and no answer.
 
L.



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