Hello,
I'm using TeeChart ActiveX Control 7.0.0.3 in my MDI-application programmed
with Visual C++ 6.0 SP4.
In a CView I have implemented the following code:
BOOL CMyView::Create(LPCTSTR lpszClassName,LPCTSTR lpszWindowName,DWORD
dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID,CCreateContext *pContext)
{
CWaitCursor WaitCursor;
if
(!CWnd::Create(lpszClassName,lpszWindowName,dwStyle,rect,pParentWnd,nID,pCon
text))
return FALSE;
if
(!m_TeeCommander1.Create(lpszClassName,"",~WS_VISIBLE,CRect(0,0,50,50),this,
IDC_TCOMMANDER1,pContext))
return FALSE;
if
(!m_TeePreviewer1.Create(lpszClassName,"",dwStyle,CRect(0,0,50,50),this,IDC_
TPREVIEWER1,pContext))
return FALSE;
if
(!m_Chart1.Create(lpszClassName,"",dwStyle,CRect(0,0,50,50),this,IDC_TCHART1
,pContext))
return FALSE;
return TRUE;
}
void CMyView::OnInitialUpdate()
{
CView::OnInitialUpdate();
CWaitCursor WaitCursor;
pDoc=(CCavDatDoc *)GetDocument();
pMainFrame=(CMainFrame *)GetTopLevelFrame();
pChildFrame=(CChildFrame *)GetParentFrame();
m_TeeCommander1.SetChartLink(m_Chart1.GetChartLink());
m_TeePreviewer1.SetChartLink(m_Chart1.GetChartLink());
m_TeeCommander1.SetPreviewerLink(m_TeePreviewer1.GetPreviewerLink());
m_TeePreviewer1.SetMaximized(TRUE);
m_TeePreviewer1.SetPreviewTitle("Radienabwicklung in 3D");
m_Chart1.SetVisible(true);
m_Chart1.GetScroll().SetEnable(FALSE);
m_Chart1.GetZoom().SetEnable(FALSE);
m_Chart1.GetHeader().SetVisible(TRUE); // keinen Diagramm-Titel
einzeichnen
m_Chart1.AddSeries(scSurface);
m_Chart1.Series(0).SetTitle("X,Y,Z");
m_Chart1.GetLegend().SetVisible(FALSE); // Legende abschalten
// Set Background color
/*m_Chart1.GetPanel().GetGradient().SetVisible(TRUE);
m_Chart1.GetPanel().GetGradient().SetDirection(gdTopBottom);
if (m_Chart1.GetCanvas().IsScreenHighColor())
m_Chart1.GetPanel().GetGradient().SetEndColor(RGB(0,0,131));*/
m_Chart1.GetPanel().SetColor(RGB(255,255,255));
m_Chart1.GetWalls().GetBottom().SetTransparent(TRUE);
m_Chart1.GetAxis().GetLeft().SetAutomatic(TRUE);
m_Chart1.GetAxis().GetBottom().SetAutomatic(TRUE);
m_Chart1.GetAxis().GetDepth().SetAutomatic(TRUE);
m_Chart1.GetAxis().GetDepth().SetIncrement(20);
m_Chart1.GetAxis().GetDepth().SetVisible(TRUE);
m_Chart1.GetTools().Add(tcRotate);
m_Chart1.GetTools().GetItems(0).SetActive(TRUE);
m_Chart1.GetTools().GetItems(0).GetAsRotate().SetButton(mbLeft);
m_Chart1.GetWalls().GetLeft().SetColor(RGB(255,255,255));
m_Chart1.GetPrinterDevice().SetMarginLeft(0);
m_Chart1.GetPrinterDevice().SetMarginRight(0);
m_Chart1.GetPrinterDevice().SetMarginTop(0);
m_Chart1.GetPrinterDevice().SetMarginBottom(0);
m_Chart1.GetAspect().SetChart3DPercent(100);
m_Chart1.GetAspect().SetOrthogonal(FALSE);
// draw grid without OpenGL
m_Chart1.Series(0).GetAsSurface().SetUsePalette(TRUE);
m_Chart1.Series(0).GetAsSurface().SetPaletteStyle(psStrong);
m_Chart1.Series(0).GetAsSurface().SetPaletteSteps(30);
m_Chart1.Series(0).GetAsSurface().SetUseColorRange(FALSE);
//m_Chart1.Series(0).GetAsSurface().SetFastBrush(TRUE);
m_Chart1.Series(0).GetAsSurface().SetIrregularGrid(TRUE);
//m_Chart1.GetAspect().SetZoom(80);
// Draw fast grid:
/*m_Chart1.Series(0).GetAsSurface().SetFastBrush(TRUE);
m_Chart1.SetClipPoints(FALSE);
m_Chart1.GetWalls().GetLeft().SetVisible(FALSE);
m_Chart1.GetAxis().SetFastCalc(TRUE);*/
// Draw grid with OpenGL:
m_Chart1.GetAspect().SetZoom(40);
m_Chart1.GetAspect().GetOpenGL().SetActive(TRUE);
m_Chart1.GetAspect().GetOpenGL().SetFontOutlines(TRUE);
CString Title;
COleVariant var1(Title);
CTitles hd=m_Chart1.GetHeader();
hd.GetText().Clear();
hd.GetFont().SetBold(true);
hd.GetFont().SetSize(15);
hd.GetText().Add(*(LPCVARIANT)var1);
CString s="[°]";
m_Chart1.GetAxis().GetBottom().GetTitle().SetCaption(s);
m_Chart1.GetAxis().GetBottom().GetTitle().GetFont().SetHeight(20);
s.Format("%s [%s]",CLanguage::graph_y_axis,pDoc->data.GetUnit());
m_Chart1.GetAxis().GetDepth().GetTitle().SetCaption(s);
m_Chart1.GetAxis().GetDepth().GetTitle().GetFont().SetHeight(20);
s.Format("r [%s]",pDoc->data.GetUnit());
m_Chart1.GetAxis().GetLeft().GetTitle().SetCaption(s);
m_Chart1.GetAxis().GetLeft().GetTitle().GetFont().SetHeight(20);
Then in my drawing routine I implemented something like this:
m_Chart1.Series(0).Clear();
for (int i=0;i<180;i++)
{
for (int j=0;j<180;j++)
m_Chart1.Series(0).GetAsSurface().AddXYZ(i,100,j,"",clTeeColor);
}
What I wanted to do is, I wanted zoom backward and forward the whole chart
when I wheel with my mouse, so I implemented the following code:
BOOL CMyView::OnMouseWheel(UINT nFlags,short zDelta,CPoint pt)
{
if (nFlags & (MK_SHIFT | MK_CONTROL))
return FALSE;
return DoMouseWheel(nFlags,zDelta,pt);
}
BOOL CMyView::DoMouseWheel(UINT nFlags,short zDelta,CPoint point)
{
UNREFERENCED_PARAMETER(point);
UNREFERENCED_PARAMETER(nFlags);
UINT uWheelScrollLines=CGraphView::GetMouseScrollLines();
int nToScroll=::MulDiv(-zDelta,uWheelScrollLines,WHEEL_DELTA);
long ZoomWert=m_Chart1.GetAspect().GetZoom();
for (int i=1;i<=abs(nToScroll);i++)
{
if (zDelta>0)
ZoomWert+=1;
else
ZoomWert-=1;
}
m_Chart1.GetAspect().SetZoom(ZoomWert);
m_Chart1.Repaint();
return TRUE;
}
I don't typed here in this newsletter the *.h- definition file, because it
would be too long.
So, when I displayed my view CMyView, the OpenGL surface graph will be
displayed properly, now my problem appears.
I have a rotate tool activated, when I now rotate with left mouse button
clicked on the chart the whole chart will be rotated, that is correct as it
should be,
but after the rotation, when I now scroll with mouse wheel, the whole axes
will be scrolled to a different direction than the Series0-surface plot
!!!!!
I don't see any bug in my program code, so it must be an TeeChart 7- ActiveX
bug.
But when I now show the TeeEditor and click the OK button, and then zoom
forward and backward with mouse wheel, everything is correct, axes and
series0-plot will be zoomed forward and backward in the same direction. So
in my opinion it must be an OCX bug.
Maybe I can send you the whole source code in Visual C++, if you wish, but I
don't know where to send to.
Best regards,
Michael Kuelshammer
Germany
[/img]
Small bug in ActiveX 7.0.0.3 with OpenGL and Visual C++ 6
Hi Michael,
yes please, send me an example with which I can reproduce the problem here and I'll take a look. You can send it to the public.steema.attachments newsgroup or directly to my account : pep@steema.com
yes please, send me an example with which I can reproduce the problem here and I'll take a look. You can send it to the public.steema.attachments newsgroup or directly to my account : pep@steema.com
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi Michael,
it's not a bug, the problem is that you must disable the MouseWheelScroll with the SetMouseWheelScroll property :
m_Chart1.GetScroll().SetEnable(pmNone);
m_Chart1.GetEnvironment().SetMouseWheelScroll(false);
it's not a bug, the problem is that you must disable the MouseWheelScroll with the SetMouseWheelScroll property :
m_Chart1.GetScroll().SetEnable(pmNone);
m_Chart1.GetEnvironment().SetMouseWheelScroll(false);
Pep Jorge
http://support.steema.com
http://support.steema.com