home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / MFC / SAMPLES / VBCHART / CHARTVW.H_ / CHARTVW.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  2.9 KB  |  117 lines

  1. // chartvw.h : interface of the CChartView class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // QuickHelp and/or WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13.  
  14.  
  15. class CVbChartFrame : public CMDIChildWnd
  16. {
  17.     DECLARE_DYNCREATE(CVbChartFrame)
  18.  
  19. protected:
  20.     CVbChartFrame() {}
  21.  
  22.     CSplitterWnd    m_Splitter;
  23.  
  24.     virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
  25.  
  26. protected:
  27.     //{{AFX_MSG(CVbChartFrame)
  28.     afx_msg void OnFilePrint();
  29.     afx_msg void OnFilePrintPreview();
  30.     afx_msg void OnUpdateChartList(CCmdUI* pCmdUI);
  31.     //}}AFX_MSG
  32.     void OnChartTypeChange();
  33.  
  34.     DECLARE_MESSAGE_MAP()
  35. };  
  36.  
  37. class CChartView : public CView
  38. {
  39. protected: // create from serialization only
  40.     CChartView();
  41.     DECLARE_DYNCREATE(CChartView)
  42.  
  43. // Attributes
  44. public:
  45.     CChartDoc* GetDocument()
  46.         {
  47.             ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CChartDoc)));
  48.             return (CChartDoc*) m_pDocument;
  49.         }
  50.  
  51.  
  52.     int* m_pnData;
  53.     int  m_nDataRows;
  54.     int  m_nDataCols;
  55.     int  m_nStartRow;
  56.     int  m_nStartCol;
  57.     int  m_nChartType;
  58.  
  59.  
  60. // Operations
  61. public:
  62.     void Print();
  63.     void Preview();
  64.  
  65. // Implementation
  66. public:
  67.     virtual ~CChartView();
  68.     virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  69.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  70.  
  71.     CRect GetDisplayRect(CDC* pDC);
  72.     void PlotLineChart(CDC* pDC);
  73.     void PlotBarChart(CDC* pDC, BOOL bVert);
  74.     void Plot3DBarChart(CDC* pDC, BOOL bVert);
  75.     void PlotGanttChart(CDC* pDC, BOOL bVert);
  76.     int GetMaxValue();
  77.     void GetDataFromGrid();
  78.     int GetTickValue(int nMaxValue, int nNumDiv);
  79.     void PlotCaptions(CDC* pDC, CPoint ptOrigin, CSize sizePixelsPerTick,
  80.                     int nValue, int nValuePerTick, int nNumTicks,
  81.                     int nCharHeight, BOOL bVert, BOOL bAlpha);
  82.     void PlotAxes(CDC* pDC, CPoint ptOrigin, CSize sizePixelsPerTick,
  83.                     int nHorzTicks, int nVertTicks, int nDrawTicks);
  84.     int GetChartMetrics(CDC* pDC, int nHDiv, int nVDiv, CSize& sizeGraph,
  85.                     CSize& sizePixelsPerTick, CPoint& ptOrigin);
  86.  
  87.     virtual void OnActivateView(BOOL bActivate, CView* pActivateView,
  88.                     CView* pDeactiveView);
  89.  
  90.     // Printing support
  91. protected:
  92.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  93.  
  94. // Generated message map functions
  95. protected:
  96.     //{{AFX_MSG(CChartView)
  97.     //}}AFX_MSG
  98.     DECLARE_MESSAGE_MAP()
  99. };
  100.  
  101.  
  102. #define CHART_LINE      0
  103. #define CHART_VBAR      1
  104. #define CHART_HBAR      2
  105. #define CHART_3DVBAR    3
  106. #define CHART_3DHBAR    4
  107. #define CHART_VGANTT    5
  108. #define CHART_HGANTT    6
  109.  
  110. #define TICKS_NONE  0
  111. #define TICKS_VERT  1
  112. #define TICKS_HORZ  2
  113. #define TICKS_BOTH  3
  114.  
  115.  
  116. /////////////////////////////////////////////////////////////////////////////
  117.