Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Chart Control
  New Posts New Posts RSS Feed - Series Picking
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Series Picking

 Post Reply Post Reply
Author
Message
lrenoux View Drop Down
Groupie
Groupie


Joined: 20 April 2009
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote lrenoux Quote  Post ReplyReply Direct Link To This Post Topic: Series Picking
    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.
 
Back to Top
lrenoux View Drop Down
Groupie
Groupie


Joined: 20 April 2009
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote lrenoux Quote  Post ReplyReply Direct Link To This Post 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.
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.141 seconds.