|
Is there a basic example of using ViewPortManager? |
Posted by redblue on Mar-01-2017 21:06 |
|
Hi,
I am trying to build a basic chart under windows (not MFC) in C++ and I want to take advantage of zooming/scrolling but I don't know where to start. Is there a basic example anywhere? I can create a basic chart, but I don't understand how to create ViewPortManager and ViewPortControlBase objects and get them working together in a GUI. Is there a basic example anywhere to get started with?
Regards, |
Re: Is there a basic example of using ViewPortManager? |
Posted by Peter Kwan on Mar-01-2017 23:17 |
|
Hi redblue,
C++ by itself does not support graphical user interface. So all graphical user interface must be provided by a third party GUI framework. There are dozens of C++ GUI framework available, such as MFC, Qt, Cocoa, GTK+, wxWidgets, OWL, VCL, Skia, etc..
The zooming and scrolling interface is a GUI interface (the charts are displayed on a window and user can manipulate it using the mouse), so it must be based on some GUI framework. As it is not practical for us to provide examples for all GUI frameworks in C++, we just choose two that are most common - MFC and Qt.
So the examples for using ViewPortManager and ViewPortControlBase are the MFC and Qt examples. The MFC CChartViewer and the Qt QChartViewer are both derived from ViewPortManager. They are provided as source code to act as examples, so developers using other GUI frameworks can port them. Similarly, the MFC CViewPortControl and Qt QViewPortControl are derived from ViewPortControlBase, and are released as source code, so developers using other GUI frameworks can port them.
Which GUI framework are you using?
Regards
Peter Kwan |
Re: Is there a basic example of using ViewPortManager? |
Posted by redblue on Mar-01-2017 23:35 |
|
Peter Kwan wrote:
So the examples for using ViewPortManager and ViewPortControlBase are the MFC and Qt examples. The MFC CChartViewer and the Qt QChartViewer are both derived from ViewPortManager. They are provided as source code to act as examples, so developers using other GUI frameworks can port them. Similarly, the MFC CViewPortControl and Qt QViewPortControl are derived from ViewPortControlBase, and are released as source code, so developers using other GUI frameworks can port them.
Which GUI framework are you using?
Hi Peter,
Thanks for the quick reply. I've looked at the MFC CViewPortControl but I must admit I got lost in the code:) I'm using native win32 API and have a variety charts plotting into a HDC, but I can't seem to understand how to create ViewPortManager and ViewPortControlBase objects and associate them to a basic chart and HDC etc.
Regards, |
|