home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / RealTime Graphics ActiveX / DATA.3 / Examples / CPP / Scroll / ScrollView.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-16  |  14.8 KB  |  494 lines

  1. // ScrollView.cpp : implementation of the CMyScrollView class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Scroll.h"
  6.  
  7. #include "ScrollDoc.h"
  8. #include "ScrollView.h"
  9. #include "ctwxdef.h"
  10. #include <math.h>
  11.  
  12. #ifdef _DEBUG
  13. #define new DEBUG_NEW
  14. #undef THIS_FILE
  15. static char THIS_FILE[] = __FILE__;
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CMyScrollView
  20.  
  21. IMPLEMENT_DYNCREATE(CMyScrollView, CFormView)
  22.  
  23. BEGIN_MESSAGE_MAP(CMyScrollView, CFormView)
  24.     //{{AFX_MSG_MAP(CMyScrollView)
  25.         // NOTE - the ClassWizard will add and remove mapping macros here.
  26.         //    DO NOT EDIT what you see in these blocks of generated code!
  27.     //}}AFX_MSG_MAP
  28.     // Standard printing commands
  29.     ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
  30.     ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
  31.     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
  32. END_MESSAGE_MAP()
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CMyScrollView construction/destruction
  36.  
  37. CMyScrollView::CMyScrollView()
  38.     : CFormView(CMyScrollView::IDD)
  39. {
  40.     //{{AFX_DATA_INIT(CMyScrollView)
  41.         // NOTE: the ClassWizard will add member initialization here
  42.     //}}AFX_DATA_INIT
  43.     // TODO: add construction code here
  44.  
  45. }
  46.  
  47. CMyScrollView::~CMyScrollView()
  48. {
  49. }
  50.  
  51. void CMyScrollView::DoDataExchange(CDataExchange* pDX)
  52. {
  53.     CFormView::DoDataExchange(pDX);
  54.     //{{AFX_DATA_MAP(CMyScrollView)
  55.     DDX_Control(pDX, IDC_SCROLLXCTRL1, m_RTScroll1);
  56.     DDX_Control(pDX, IDC_SCROLLXCTRL2, m_RTScroll2);
  57.     DDX_Control(pDX, IDC_SCROLLXCTRL3, m_RTScroll3);
  58.     DDX_Control(pDX, IDC_SCROLLXCTRL4, m_RTScroll4);
  59.     DDX_Control(pDX, IDC_SCROLLXCTRL5, m_RTScroll5);
  60.     //}}AFX_DATA_MAP
  61. }
  62.  
  63. BOOL CMyScrollView::PreCreateWindow(CREATESTRUCT& cs)
  64. {
  65.     // TODO: Modify the Window class or styles here by modifying
  66.     //  the CREATESTRUCT cs
  67.  
  68.     return CFormView::PreCreateWindow(cs);
  69. }
  70.  
  71. /////////////////////////////////////////////////////////////////////////////
  72. // CMyScrollView printing
  73.  
  74. BOOL CMyScrollView::OnPreparePrinting(CPrintInfo* pInfo)
  75. {
  76.     // default preparation
  77.     return DoPreparePrinting(pInfo);
  78. }
  79.  
  80. void CMyScrollView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  81. {
  82.     // TODO: add extra initialization before printing
  83. }
  84.  
  85. void CMyScrollView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  86. {
  87.     // TODO: add cleanup after printing
  88. }
  89.  
  90. void CMyScrollView::OnPrint(CDC* pDC, CPrintInfo*)
  91. {
  92.     // TODO: add code to print the controls
  93. }
  94.  
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CMyScrollView diagnostics
  97.  
  98. #ifdef _DEBUG
  99. void CMyScrollView::AssertValid() const
  100. {
  101.     CFormView::AssertValid();
  102. }
  103.  
  104. void CMyScrollView::Dump(CDumpContext& dc) const
  105. {
  106.     CFormView::Dump(dc);
  107. }
  108.  
  109. CScrollDoc* CMyScrollView::GetDocument() // non-debug version is inline
  110. {
  111.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CScrollDoc)));
  112.     return (CScrollDoc*)m_pDocument;
  113. }
  114. #endif //_DEBUG
  115.  
  116. /////////////////////////////////////////////////////////////////////////////
  117. // CMyScrollView message handlers
  118.  
  119. BEGIN_EVENTSINK_MAP(CMyScrollView, CFormView)
  120.     //{{AFX_EVENTSINK_MAP(CMyScrollView)
  121.     ON_EVENT(CMyScrollView, IDC_SCROLLXCTRL1, 1 /* OnInternalTimer */, OnInternalTimerScrollxctrl1, VTS_NONE)
  122.     ON_EVENT(CMyScrollView, IDC_SCROLLXCTRL2, 1 /* OnInternalTimer */, OnInternalTimerScrollxctrl2, VTS_NONE)
  123.     ON_EVENT(CMyScrollView, IDC_SCROLLXCTRL3, 1 /* OnInternalTimer */, OnInternalTimerScrollxctrl3, VTS_NONE)
  124.     ON_EVENT(CMyScrollView, IDC_SCROLLXCTRL4, 1 /* OnInternalTimer */, OnInternalTimerScrollxctrl4, VTS_NONE)
  125.     ON_EVENT(CMyScrollView, IDC_SCROLLXCTRL5, 1 /* OnInternalTimer */, OnInternalTimerScrollxctrl5, VTS_NONE)
  126.     //}}AFX_EVENTSINK_MAP
  127. END_EVENTSINK_MAP()
  128.  
  129.  
  130. void CMyScrollView::OnInternalTimerScrollxctrl1() 
  131. {
  132.  
  133.     double rData[16];
  134.     int        i;
  135.     static double rLastData[16];
  136.     static BOOL bFirstDemoPass = FALSE;
  137.     
  138.     double rMin = min( m_RTScroll1.GetAxisMin (Y_AXIS1), m_RTScroll1.GetAxisMax (Y_AXIS1));
  139.     double rMax = max( m_RTScroll1.GetAxisMin (Y_AXIS1), m_RTScroll1.GetAxisMax (Y_AXIS1));
  140.     double rCenter = (rMax - rMin) /2;
  141.     double rRange = (rMin - rMax);
  142.     
  143.     for (i=0; i < m_RTScroll1.GetSDataNumGroups (0); i++)
  144.     {
  145.         if (!bFirstDemoPass)
  146.             rData[i] = rCenter + rRange * 1.0 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  147.         else
  148.             rData[i] = rLastData[i] + rRange * 0.2 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  149.  
  150.         if (rData[i] > rMax)
  151.             rData[i] = rMax;
  152.         else
  153.             if (rData[i] < rMin) 
  154.                 rData[i] = rMin;
  155.         rLastData[i] = rData[i];
  156.     }
  157.  
  158.     bFirstDemoPass = TRUE; 
  159.     m_RTScroll1.UpdateDynData (0, rData);
  160. }
  161.  
  162. void CMyScrollView::OnInternalTimerScrollxctrl2() 
  163. {
  164.     double rData[16], rData2[16];
  165.     int        i;
  166.     static double rLastData[16], rLastData2[16];
  167.     static BOOL bFirstDemoPass = FALSE;
  168.     
  169.     double rMin = min( m_RTScroll2.GetAxisMin (X_AXIS1), m_RTScroll2.GetAxisMax (X_AXIS1));
  170.     double rMax = max( m_RTScroll2.GetAxisMin (X_AXIS1), m_RTScroll2.GetAxisMax (X_AXIS1));
  171.     double rCenter = (rMax - rMin) /2;
  172.     double rRange = (rMin - rMax);
  173.     
  174.     for (i=0; i < m_RTScroll2.GetSDataNumGroups (0); i++)
  175.     {
  176.         if (!bFirstDemoPass)
  177.             rData[i] = rCenter + rRange * 1.0 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  178.         else
  179.             rData[i] = rLastData[i] + rRange * 0.2 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  180.  
  181.         if (rData[i] > rMax)
  182.             rData[i] = rMax;
  183.         else
  184.             if (rData[i] < rMin) 
  185.                 rData[i] = rMin;
  186.         rLastData[i] = rData[i];
  187.     }
  188.  
  189.     for (i=0; i < m_RTScroll2.GetSDataNumGroups (1); i++)
  190.     {
  191.         if (!bFirstDemoPass)
  192.             rData2[i] = rCenter + rRange * 0.05 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  193.         else
  194.             rData2[i] = rLastData2[i] + rRange * 0.2 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  195.  
  196.         if (rData2[i] > rMax)
  197.             rData2[i] = rMax;
  198.         else
  199.             if (rData2[i] < rMin) 
  200.                 rData2[i] = rMin;
  201.         rLastData2[i] = rData2[i];
  202.     }
  203.  
  204.  
  205.     bFirstDemoPass = TRUE; 
  206.     m_RTScroll2.UpdateDynData (0, rData);
  207.     m_RTScroll2.UpdateDynData (0, rData2);
  208.     
  209. }
  210.  
  211. void CMyScrollView::OnInternalTimerScrollxctrl3() 
  212. {
  213.     double rData[16];
  214.     int        i;
  215.     static double rLastData[16];
  216.     static BOOL bFirstDemoPass = FALSE;
  217.     
  218.     double rMin = min( m_RTScroll3.GetAxisMin (Y_AXIS1), m_RTScroll3.GetAxisMax (Y_AXIS1));
  219.     double rMax = max( m_RTScroll3.GetAxisMin (Y_AXIS1), m_RTScroll3.GetAxisMax (Y_AXIS1));
  220.     double rCenter = (rMax - rMin) /2;
  221.     double rRange = (rMin - rMax);
  222.     
  223.     for (i=0; i < m_RTScroll3.GetSDataNumGroups(0); i++)
  224.     {
  225.         if (!bFirstDemoPass)
  226.             rData[i] = rCenter + rRange * 1.0 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  227.         else
  228.             rData[i] = rLastData[i] + rRange * 0.2 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  229.  
  230.         if (rData[i] > rMax)
  231.             rData[i] = rMax;
  232.         else
  233.             if (rData[i] < rMin) 
  234.                 rData[i] = rMin;
  235.         rLastData[i] = rData[i];
  236.     }
  237.  
  238.     bFirstDemoPass = TRUE; 
  239.     m_RTScroll3.UpdateDynData (0, rData);
  240.     
  241. }
  242.  
  243. void CMyScrollView::OnInternalTimerScrollxctrl4() 
  244. {
  245.     static nUpdateCounter=0;
  246.     
  247.     double rData[16];
  248.     int        i;
  249.     static double rLastData[16];
  250.     static BOOL bFirstDemoPass = FALSE;
  251.     
  252.     double rMin = min( m_RTScroll3.GetAxisMin (Y_AXIS1), m_RTScroll3.GetAxisMax (Y_AXIS1));
  253.     double rMax = max( m_RTScroll3.GetAxisMin (Y_AXIS1), m_RTScroll3.GetAxisMax (Y_AXIS1));
  254.     double rCenter = (rMax - rMin) /2;
  255.     double rRange = (rMin - rMax);
  256.  
  257.     for (i=0; i <  m_RTScroll4.GetSDataNumGroups(0); i++)
  258.     {
  259.         if (i < (m_RTScroll4.GetSDataNumGroups(0) -1))
  260.         {
  261.             if (!bFirstDemoPass)
  262.                 rData[i] = rCenter + rRange * 1.0 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  263.             else
  264.                 rData[i] = rLastData[i] + rRange * 0.2 * ( 0.5 - ((double) rand() / (double) RAND_MAX));
  265.             if (rData[i] > rMax)
  266.                 rData[i] = rMax;
  267.             else
  268.                 if (rData[i] < rMin) 
  269.                     rData[i] = rMin;
  270.             rLastData[i] = rData[i];
  271.         } else
  272.         {  
  273.             if ((nUpdateCounter / 20) % 2)
  274.                 rData[i] =  20.0 * ((double) rand() / (double) RAND_MAX);
  275.             else
  276.                 rData[i] =  2.0 * ((double) rand() / (double) RAND_MAX);
  277.         }
  278.     }
  279.     nUpdateCounter++; 
  280.     bFirstDemoPass = TRUE; 
  281.     m_RTScroll4.UpdateDynData (0, rData);
  282.  
  283. }
  284.  
  285. void CMyScrollView::OnInternalTimerScrollxctrl5() 
  286. {
  287.     static nUpdateCounter=0;
  288.     
  289.     double rData[16];
  290.     double rMin = min( m_RTScroll5.GetAxisMin (Y_AXIS1), m_RTScroll5.GetAxisMax (Y_AXIS1));
  291.     double rMax = max( m_RTScroll5.GetAxisMin (Y_AXIS1), m_RTScroll5.GetAxisMax (Y_AXIS1));
  292.     double rRange = (rMin - rMax);
  293.     double rUpdateValue;
  294.     int        i;
  295.  
  296.     int npp = m_RTScroll5.GetScrollXYNumPoints(0);
  297.     
  298.     int ng = m_RTScroll5.GetSDataNumGroups(0);
  299.     for (i=0; i < m_RTScroll5.GetSDataNumGroups(0)/2; i++)
  300.     { 
  301.         rUpdateValue = (double) nUpdateCounter  / (m_RTScroll5.GetScrollXYNumPoints(0)/6.2);    
  302.         rData[i] = 0.95 * rRange * sin ( rUpdateValue ) / 2; 
  303.         rData[i+m_RTScroll5.GetSDataNumGroups(0)/2] = 0.95 * rRange * 
  304.             sin(rUpdateValue *1.1 + 0.5 + (double)i * rUpdateValue)/2;
  305.     }
  306.     nUpdateCounter++; 
  307.     m_RTScroll5.UpdateDynData (0, rData);
  308.         
  309. }
  310.  
  311.  
  312.  
  313.  
  314. void CMyScrollView::BuildGraph1()
  315. {
  316.     m_RTScroll1.SetSDataEnable (0, TRUE); // enable the 1st data set
  317.     m_RTScroll1.SetSPlotType (0, SCROLLING_LINE_GRAPH);
  318.     m_RTScroll1.SetSDataNumGroups (0, 4); // four channels of data
  319.  
  320.     //axis
  321.     m_RTScroll1.SetAxisMax (X_AXIS1, 25.0); // x axis from 0 - 25
  322.     m_RTScroll1.SetAxisEnable (X_AXIS2, TRUE); //enable the second x axis
  323.     m_RTScroll1.SetAxisEnable (Y_AXIS2, TRUE); //enable the second x axis
  324.     m_RTScroll1.SetAxisMajorTickInterval (X_AXIS1, 5.0); //label every 5 units
  325.  
  326.     //alarm updating
  327.     m_RTScroll1.SetScrollAlarmMarksEnable (0, TRUE); //enable alarm marks
  328.     m_RTScroll1.SetScrollLowAlarmEnable (0, TRUE); //enable lo alarm line
  329.     m_RTScroll1.SetScrollHighAlarmEnable (0, TRUE); //enable hi alarm line
  330.     m_RTScroll1.SetScrollSetpointEnable (0, TRUE); //enable set point line
  331.  
  332.     //title
  333.     m_RTScroll1.SetTitleString (TITLE1,"Scroll Graph");  //graph title
  334.     
  335.     //window
  336.     m_RTScroll1.SetWindowBackgroundColor (C_PALEBLUE);  //background color
  337.     m_RTScroll1.SetWindowBorderStyle (RC_HIGH); 
  338.     
  339.     //use internal timer
  340.     m_RTScroll1.SetEnableInternalTimer(TRUE);
  341.     
  342. }
  343.  
  344.  
  345. void CMyScrollView::BuildGraph2()
  346. {
  347.     m_RTScroll2.SetSPlotType (0, SWEEP_GRAPH); //<<constant needed for type
  348.     m_RTScroll2.SetScrollDirection (0, OR_VERT); // vertical scrolling 
  349.     m_RTScroll2.SetScrollDirection (1, OR_VERT); // vertical scrolling 
  350.     m_RTScroll2.SetSDataEnable (0, TRUE); // enable the 1st data set
  351.     m_RTScroll2.SetSDataNumGroups (0, 2); // two channels of data
  352.     m_RTScroll2.SetSDataEnable (1, TRUE); // enable the 2ND data set
  353.     m_RTScroll2.SetSDataNumGroups (1, 1); // one channels of data
  354.  
  355.     //axis attributes
  356.     m_RTScroll2.SetAxisMax (Y_AXIS1, 25.0); // Y axis from 0 - 25
  357.     m_RTScroll2.SetAxisMajorTickInterval (Y_AXIS1, 5.0);
  358.     
  359.     //font attributes for axis labels
  360.     m_RTScroll2.SetAxisLabelFontStyle (X_AXIS1, TEXT_BOLD);
  361.     m_RTScroll2.SetAxisLabelFontStyle (Y_AXIS1, TEXT_BOLD);
  362.     m_RTScroll2.SetAxisLabelFontSize (X_AXIS1, 10);
  363.     m_RTScroll2.SetAxisLabelFontSize (Y_AXIS1, 10);
  364.     m_RTScroll2.SetAxisLabelColor (X_AXIS1, C_LIGHTBLUE);
  365.     m_RTScroll2.SetAxisLabelColor (Y_AXIS1, C_LIGHTBLUE);
  366.  
  367.     m_RTScroll2.SetScrollSweepLineColor (0, C_LIGHTRED); // set color for sweep line
  368.     m_RTScroll2.SetScrollLineColor (0, 0, C_YELLOW);
  369.     m_RTScroll2.SetScrollLineColor (0, 1, C_WHITE);
  370.     m_RTScroll2.SetScrollLineColor (1, 0, C_BLUE);
  371.  
  372.     //title
  373.     m_RTScroll2.SetTitleString (TITLE1,"Sweep Graph");
  374.     m_RTScroll2.SetTitleFontStyle (TITLE1, TEXT_BOLD);
  375.     m_RTScroll2.SetTitleFontSize (TITLE1, 12);
  376.  
  377.     m_RTScroll2.SetAxisTitleString (X_AXIS1,"X Axis Title");
  378.     m_RTScroll2.SetAxisTitleString (Y_AXIS1,"Y Axis Title");
  379.  
  380.     //colors
  381.     m_RTScroll2.SetPlotBackgroundColor (RGB (128, 128, 255));
  382.     m_RTScroll2.SetWindowBackgroundColor (C_PALEBLUE);
  383.     
  384.     //plotting area
  385.     m_RTScroll2.SetRightPlotArea (0.92);
  386.     m_RTScroll2.SetBottomPlotArea (0.8);
  387.  
  388.     //use internal timer
  389.     m_RTScroll2.SetEnableInternalTimer(TRUE);
  390. }
  391.  
  392.  
  393. void CMyScrollView::BuildGraph3()
  394. {
  395.     m_RTScroll3.SetSPlotType (0, SCROLLING_BAR_GRAPH  ); //<<constant needed for type
  396.     m_RTScroll3.SetSDataEnable (0, TRUE); // enable the 1st data set
  397.     m_RTScroll3.SetScrollRelReset (0, 0.5); //reset to 1/2
  398.     
  399.     //axis
  400.     m_RTScroll3.SetAxisMax (Y_AXIS1, 15.0); // y axis range -5  to 15
  401.     m_RTScroll3.SetAxisMin (Y_AXIS1, -5.0); 
  402.     m_RTScroll3.SetAxisMajorTickInterval (Y_AXIS1, 5.0); //label every 5 units
  403.     m_RTScroll3.SetAxisGridEnable (Y_AXIS1, TRUE);
  404.     
  405.     //colors
  406.     m_RTScroll3.SetWindowBackgroundColor (C_PALEBLUE);
  407.     
  408.     //title
  409.     m_RTScroll3.SetTitleFontStyle (TITLE1, TEXT_BOLD);
  410.     m_RTScroll3.SetTitleString (TITLE1,"Scrolling Bar");
  411.     
  412.     //internal timer
  413.     m_RTScroll3.SetEnableInternalTimer(TRUE);
  414.  
  415. }
  416.  
  417.  
  418. void CMyScrollView::BuildGraph4()
  419. {
  420.     CString sLegendStrings, CR = " ";
  421.  
  422.     m_RTScroll4.SetSPlotType (0, VARIABLE_SCROLLING_GRAPH); //<<constant
  423.     m_RTScroll4.SetTitleString (TITLE1, "Variable Scrolling");
  424.     m_RTScroll4.SetSDataEnable (0, TRUE); // enable the 1st data set
  425.     m_RTScroll4.SetSDataNumGroups (0, 5); // Groups must = #channels + 1
  426.     m_RTScroll4.SetAxisMax (X_AXIS1, 50.0); // x axis from 0 - 50
  427.  
  428.     m_RTScroll4.SetScrollLineColor(0, 0, C_GREEN);
  429.     m_RTScroll4.SetScrollLineColor(0, 1, C_LIGHTMAGENTA);
  430.     m_RTScroll4.SetScrollLineColor(0, 2, C_LIGHTRED);
  431.     m_RTScroll4.SetScrollLineColor(0, 3, C_LIGHTBLUE);
  432.     
  433.     m_RTScroll4.SetLeftPlotArea (0.12);
  434.     m_RTScroll4.SetTopPlotArea (0.3);
  435.     m_RTScroll4.SetRightPlotArea (0.92);
  436.     m_RTScroll4.SetBottomPlotArea (0.87);
  437.  
  438.     //legends
  439.     CR.SetAt(0,(char) 13); // make CR a carriage return string;
  440.     sLegendStrings = "Boston" + CR + "Chicago" + CR + "Los Angeles" + CR +"Dallas" + CR;
  441.     m_RTScroll4.SetSLegendEnable (TRUE); //must enable to view!
  442.     m_RTScroll4.SetSLegendLeft (0.05);  //establish position
  443.     m_RTScroll4.SetSLegendTop (0.08);
  444.     m_RTScroll4.SetSLegendRight (0.95);
  445.     m_RTScroll4.SetSLegendBottom(0.27);
  446.     m_RTScroll4.SetSLegendOrientation (OR_HORZ); //horizontal 
  447.     m_RTScroll4.SetSLegendFontSize (8);
  448.      m_RTScroll4.SetSLegendStrings(sLegendStrings);
  449.  
  450.     //colors
  451.     m_RTScroll4.SetWindowBackgroundColor (C_PALEBLUE);
  452.     
  453.     //internal timer
  454.     m_RTScroll4.SetEnableInternalTimer(TRUE);
  455.     
  456. }
  457.  
  458. void CMyScrollView::BuildGraph5()
  459. {
  460.     m_RTScroll5.SetSPlotType (0, SCROLLING_XY_GRAPH); //<<constant needed for type
  461.     m_RTScroll5.SetSDataNumGroups (0, 4); // groups must = #channels * 2
  462.     m_RTScroll5.SetSDataEnable (0, TRUE); // enable the 1st data set
  463.     m_RTScroll5.SetScrollXYNumPoints (0, 100); // 100 pts in the buffer
  464.  
  465.     //axis
  466.     m_RTScroll5.SetAxisMin (X_AXIS1, -10.0); // x axis from -10 - 10
  467.     m_RTScroll5.SetAxisMax (X_AXIS1, 10.0);
  468.     m_RTScroll5.SetAxisMin (Y_AXIS1, -10.0); // x axis from -10 - 10
  469.     m_RTScroll5.SetAxisMax (Y_AXIS1, 10.0);
  470.     
  471.     //color
  472.     m_RTScroll5.SetWindowBackgroundColor (C_PALEBLUE);
  473.  
  474.     //title
  475.     m_RTScroll5.SetTitleString (TITLE1,"XY Plot");
  476.     
  477.     //timer
  478.     m_RTScroll5.SetEnableInternalTimer(TRUE);
  479. }
  480.  
  481.  
  482.  
  483. void CMyScrollView::OnInitialUpdate() 
  484. {
  485.     CFormView::OnInitialUpdate();
  486.     
  487.     BuildGraph1();
  488.     BuildGraph2();
  489.     BuildGraph3();
  490.     BuildGraph4();
  491.     BuildGraph5();
  492.     
  493. }
  494.