home *** CD-ROM | disk | FTP | other *** search
- // mygravw.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "mygraph.h"
- #include "mygravw.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMygraphView
-
- IMPLEMENT_DYNCREATE(CMygraphView, CFormView)
-
- CMygraphView::CMygraphView()
- : CFormView(CMygraphView::IDD)
- {
- //{{AFX_DATA_INIT(CMygraphView)
- m_graph = NULL;
- //}}AFX_DATA_INIT
- }
-
- CMygraphView::~CMygraphView()
- {
- }
-
- void CMygraphView::DoDataExchange(CDataExchange* pDX)
- {
- CFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMygraphView)
- DDX_VBControl(pDX, IDC_GRAPH1, m_graph);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CMygraphView, CFormView)
- //{{AFX_MSG_MAP(CMygraphView)
- ON_BN_CLICKED(IDC_SECOND_BUTTON, OnSecondButton)
- ON_BN_CLICKED(IDC_PRINT_BUTTON, OnPrintButton)
- ON_BN_CLICKED(IDC_BUTTON_1, OnButton1)
- ON_BN_CLICKED(IDC_BUTTON_2, OnButton2)
- ON_BN_CLICKED(IDC_BUTTON_3, OnButton3)
- ON_BN_CLICKED(IDC_BUTTON_4, OnButton4)
- ON_BN_CLICKED(IDC_BUTTON_5, OnButton5)
- ON_BN_CLICKED(IDC_BUTTON_6, OnButton6)
- ON_BN_CLICKED(IDC_BUTTON_7, OnButton7)
- ON_BN_CLICKED(IDC_BUTTON_8, OnButton8)
- ON_BN_CLICKED(IDC_BUTTON_9, OnButton9)
- ON_BN_CLICKED(IDC_BUTTON_10, OnButton10)
- ON_VBXEVENT(VBN_CLICK, IDC_GRAPH1, OnClickGraph1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CMygraphView message handlers
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- void CMygraphView::OnInitialUpdate()
- {
-
- // Call the base class function.
- CFormView::OnInitialUpdate();
-
-
- // Set the current point to 1
- m_graph->SetNumProperty("ThisPoint",1);
- // Set the current data to 10.
- m_graph->SetFloatProperty("GraphData",10);
-
-
- // Set the current point to 2
- m_graph->SetNumProperty("ThisPoint",2);
- // Set the current data to 8.
- m_graph->SetFloatProperty("GraphData",8);
-
-
- // Set the current point to 3
- m_graph->SetNumProperty("ThisPoint",3);
- // Set the current data to 6.
- m_graph->SetFloatProperty("GraphData",6);
-
-
- // Set the current point to 4
- m_graph->SetNumProperty("ThisPoint",4);
- // Set the current data to 4.
- m_graph->SetFloatProperty("GraphData",4);
-
-
- // Set the current point to 5
- m_graph->SetNumProperty("ThisPoint",5);
- // Set the current data to 2.
- m_graph->SetFloatProperty("GraphData",2);
-
- }
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- void CMygraphView::OnSecondButton()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Set the NumSets property to 2
- m_graph->SetNumProperty("NumSets",2);
-
- // Set the ThisSet property to 2
- m_graph->SetNumProperty("ThisSet",2);
-
- // Set the NumPoints property to 5
- m_graph->SetNumProperty("NumPoints",5);
-
- // Set the current point to 1
- m_graph->SetNumProperty("ThisPoint",1);
- // Set the current data to 2.
- m_graph->SetFloatProperty("GraphData",2);
-
-
- // Set the current point to 2
- m_graph->SetNumProperty("ThisPoint",2);
- // Set the current data to 4.
- m_graph->SetFloatProperty("GraphData",4);
-
-
- // Set the current point to 3
- m_graph->SetNumProperty("ThisPoint",3);
- // Set the current data to 6.
- m_graph->SetFloatProperty("GraphData",6);
-
-
- // Set the current point to 4
- m_graph->SetNumProperty("ThisPoint",4);
- // Set the current data to 8.
- m_graph->SetFloatProperty("GraphData",8);
-
-
- // Set the current point to 5
- m_graph->SetNumProperty("ThisPoint",5);
- // Set the current data to 10.
- m_graph->SetFloatProperty("GraphData",10);
-
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMygraphView::OnPrintButton()
- {
- // TODO: Add your control notification handler code here
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("DrawMode",5);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
-
- }
-
- void CMygraphView::OnButton1()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",1);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
- }
-
- void CMygraphView::OnButton2()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",2);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-
- void CMygraphView::OnButton3()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",3);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMygraphView::OnButton4()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",4);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-
- void CMygraphView::OnButton5()
- {
- // TODO: Add your control notification handler code here
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",5);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMygraphView::OnButton6()
- {
- // TODO: Add your control notification handler code here
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",6);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMygraphView::OnButton7()
- {
- // TODO: Add your control notification handler code here
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",7);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMygraphView::OnButton8()
- {
- // TODO: Add your control notification handler code here
-
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",8);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMygraphView::OnButton9()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",9);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-
- void CMygraphView::OnButton10()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- m_graph->SetNumProperty("GraphType",10);
-
- // Draw it
- m_graph->SetNumProperty("DrawMode",2);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMygraphView::OnClickGraph1(UINT, int, CWnd*, LPVOID)
- {
- // TODO: Add your VBX event notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
-
- // Clear the graph
- m_graph->SetNumProperty("DrawMode",1);
-
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- }
-