Im trying to generate a context menu, if the user click with the rigth mouse button on a serie.
Context menu will be shown, but after handling this, the teechart goes in the move state (the graphic always floating to the current position of the mouse pointer, until i click with the mouse agin) and the "3D view" will switched on . How can i deactivate this ???
StopMouse() function has no effect.
my code on the event :
Code: Select all
HRESULT __stdcall CPlotterView::OnClickSeries (long SeriesIndex,long ValueIndex,enum TeeChart::EMouseButton Button,enum TeeChart::EShiftState Shift,long X,long Y )
{
HRESULT hr = S_OK;
if((Button == mbRight) && (Shift==ssNone))
{
// Context Menu oeffnen
HMENU hmenu = ::LoadMenu(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_SERIES_CONTEXT));
ATLASSERT(hmenu != NULL);
// Get the position of the mouse pointer.
POINT ptMenu;
ptMenu.x = X;
ptMenu.y = Y;
/*
UINT nDummy = 0;
HTREEITEM hItem = HitTest(ptMenu, &nDummy);
if(hItem == NULL) return hr;
*/
HMENU hPopup = NULL;
hPopup = ::GetSubMenu(hmenu, 0);
if(hPopup != NULL)
{
m_lastSelectedSeries = SeriesIndex;
ClientToScreen(&ptMenu);
::TrackPopupMenu(hPopup, TPM_LEFTALIGN | TPM_RIGHTBUTTON,
(ptMenu.x), (ptMenu.y), 0, m_hWnd, NULL);
}
/*
// signalId von der Serie Holen ....
long lngId = 14869;
::PostMessage(m_pDoc->GetFrameWndHandle(),WM_SIGINFO_OPEN,lngId,lngId);
*/
}
// test Scrolling deactivieren
hr = m_spTChart->StopMouse();
return hr;
}