Page 1 of 1

Zoom in/out with mouse

Posted: Wed Feb 24, 2010 6:14 pm
by 9085137
I am using TeeChart ActiveX v8 in WTL. After instanciating TeeChart, I tried to use mouse to zoom in/out, but nothing happened. So, I set TChart->Zoom->Enable = true, but it did not work.

Also for 3D chart, rotating 3D view using mouse did not activate anything.

Do I need to add extra mouse events? In VCL, these things were automatic.

Thank you.

dalshin

Re: Zoom in/out with mouse

Posted: Thu Feb 25, 2010 11:22 am
by yeray
Hi dalshin,

Could you please send us a simple example project we can run as-is to reproduce the problem here?
You can attach your files directly here with your forum posts or at our upload page.

Thanks in advance.

Re: Zoom in/out with mouse

Posted: Fri Mar 05, 2010 3:57 pm
by 9085137
As far as I know, m_p2DChart->Zoom->Enable is TRUE as default. But it seems not in my case.
The code which I wrote is

m_p2DChart->Zoom->Enable = TRUE;
m_p2DChart->Zoom->Direction = tzdBoth;
m_p2DChart->Zoom->MouseButton = mbLeft;
m_p2DChart->Zoom->Animated = TRUE;
m_p2DChart->Zoom->AnimatedSteps = 8;
m_p2DChart->Zoom->Pen->Color = clTeeColor;
m_p2DChart->Zoom->Pen->Width = 5;

m_p2DChart->SetTheme(ctWeb, cpWeb);
m_p2DChart->Aspect->View3D = FALSE;
m_p2DChart->Axis->Visible = FALSE;
m_p2DChart->Footer->Visible = FALSE;
m_p2DChart->Header->Visible = FALSE;
m_p2DChart->Legend->Visible = FALSE;
m_p2DChart->Panel->MarginBottom = 0;
m_p2DChart->Panel->MarginLeft = 0;
m_p2DChart->Panel->MarginRight = 0;
m_p2DChart->Panel->MarginTop = 0;

But 'm_p2DChart->Zoom->Enable = TRUE' is still not working.

Thank you in advance.

Re: Zoom in/out with mouse

Posted: Fri Mar 05, 2010 5:15 pm
by yeray
Hi dalshin,

We're not familiar to the WTL. So it would be helpful if you could send us a full simple example project.
Thanks in advance.

Re: Zoom in/out with mouse

Posted: Fri Mar 19, 2010 5:29 pm
by 9085137
I tried to upload a sample project (~20MB) but could not attach it. So, I tried to directly upload to server but failed.
Is file too big? Any suggestions?

Dalshin

Re: Zoom in/out with mouse

Posted: Fri Mar 19, 2010 5:49 pm
by yeray
Hi Dalshin,

Can't you prepare a new simple application with the minimum things to reproduce the problem?
If not, do you have a server accessible through internet where you can allocate the zip? You can also try with a public server like http://www.yousendit.com/

Re: Zoom in/out with mouse

Posted: Fri Mar 19, 2010 6:18 pm
by 9085137
Yeray,

WTL project with a dialog having TChart was basically too big (even including activex ocx). I don't know how to minimize more using zipping or simplify it.
But the procedure is so simple that you can create this kind of WTL project easily.

In fact, I suspect that TeeChart event in WTL itselt does not work. So, I tested TeeChart event first. Of course, the zooming did not work either.

You can create VC++ 2008 WTL project with TeeChart ActiveX control.
What I did was as follows:
In the WTL project, I have a dialog (MainDlg) with TeeChart ActiveX control and I am trying to catch ITChartEvents from this control like OnClick() and etc. But for some reason, I am even unable to catch these events.
On the other hand, I have a webbrowserdialog in this project which has Microsoft WebBrowswer ActiveX control and I am able to catch events from this control.
Am I missing something?

See my code below:

Dialog header file: MainDlg.h
=================================================================
#pragma once
#import ".\TeeChart\TeeChart8.ocx"

using namespace TeeChart;

class CMainDlg : public CAxDialogImpl<CMainDlg>,
public IDispEventImpl<IDC_TCHART1,CMainDlg>
{
public:
enum { IDD = IDD_MAINDLG };

BEGIN_MSG_MAP(CMainDlg)
CHAIN_MSG_MAP(CAxDialogImpl<CMainDlg>)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
COMMAND_ID_HANDLER(IDOK, OnOK)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
END_MSG_MAP()

LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
BEGIN_SINK_MAP(CMainDlg)
SINK_ENTRY(IDC_TCHART1, 3, OnClickTchart1)
END_SINK_MAP()


void __stdcall OnClickTchart1(); //<============ This is my TeeChart event, and it does not work.

};

==============================================================
Dialog CPP file: MainDlg.h
===============================================================
// MainDlg.cpp : implementation of the CMainDlg class
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resource.h"

#include "MainDlg.h"

LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
// center the dialog on the screen
CenterWindow();

// set icons
HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
SetIcon(hIcon, TRUE);
HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
SetIcon(hIconSmall, FALSE);

return TRUE;
}

LRESULT CMainDlg::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{

return 0;
}

LRESULT CMainDlg::OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CSimpleDialog<IDD_ABOUTBOX, FALSE> dlg;
dlg.DoModal();
return 0;
}

LRESULT CMainDlg::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// TODO: Add validation code
EndDialog(wID);
return 0;
}

LRESULT CMainDlg::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
EndDialog(wID);
return 0;
}

void __stdcall CMainDlg::OnClickTchart1() //<============ This is my TeeChart event, and it does not work.
{
// TODO: Add your message handler code here
ATLTRACE("OnClick");
}


Thank you in advance.

Dalshin

Re: Zoom in/out with mouse

Posted: Tue Mar 23, 2010 2:26 pm
by yeray
Hi Dalshin,

Thanks for the info. I've installed WTL into VS2008 modifying the setup80.js file included with WTL package and I could create a WTL project but I'm not sure to be creating the project the same way than you.
It would be helpful if you could send the simple example project mentioned above. Note that you don't need to include the TeeChart8.ocx and you can send it attaching it here, or though our upload page, or via yousendit and sending the link to info at steeema dot com.