|
how can i zoom in or out with the mouse scroll |
Posted by tyr2000 on Mar-13-2014 20:19 |
|
Hi,
I want to zoom the finance chart with the mouse scrool rather than click the zoom button
and click the chart to zoom.
what should I do?
thanks |
Re: how can i zoom in or out with the mouse scroll |
Posted by Peter Kwan on Mar-14-2014 00:21 |
|
Hi tyr2000,
From your previous message, I think you are using C++/MFC. Am I correct?
Basically, you just need to handle the mouse wheel event (the WM_MOUSEWHEEL
message). In the mouse wheel event handler, you can modify the view port to reflect the
zooming, and then called CChartViewer::updateViewPort to trigger an update.
You may refer to the sample code "Zooming and Scrolling with Track Line (1)", "Zooming and
Scrolling with Track Line (2)" and "XY Zooming and Scrolling" for references. They are
examples that have mouse wheel support.
Hope this can help.
Regards
Peter Kwan |
Re: how can i zoom in or out with the mouse scroll |
Posted by tyr2000 on Mar-14-2014 14:16 |
|
HI ,
thank you for you replay. I do use the mfc. I put the chartview on a dialog,and handle the
scroll message.but the dialog can't get the message notify. why? Is this a bug of
chartdirector?
thanks again |
Re: how can i zoom in or out with the mouse scroll |
Posted by Peter Kwan on Mar-15-2014 00:44 |
|
Hi tyr2000,
The ChartDirector MFC sample code also puts a CChartViewer in a dialog, and it works
normally. Also, the CChartViewer cannot affect whether your dialog can receive the mouse
wheel event or not. This mouse wheel event are unrelated to ChartDirector and is just a
standard Windows event. Your own code would need to handle the event and then ask
ChartDirector to zoom in or out.
If you cannot make it work, would you mind to create a simple example (may be by
modifying one of the ChartDirector sample code), so that I can see your code exactly and
try it myself?
Regards
Peter Kwan |
|