home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / DLL_Toolkit / Source / HTBLineChart / LineChartCtrl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-03-02  |  2.2 KB  |  88 lines

  1. // LineChartCtrl.h : header file
  2. //
  3. // Written by Yuheng Zhao (yuheng@ministars.com) 
  4. // http://www.ministars.com
  5. // The original idea and part of the code from Ken C. Len's CHistogramCtrl
  6. // http://www.codeguru.com/controls/histogram_control.shtml
  7. //
  8. // Copyright (c) 1998.
  9. //
  10. // This code may be used in compiled form in any way you desire. This
  11. // file may be redistributed unmodified by any means PROVIDING it is 
  12. // not sold for profit without the authors written consent, and 
  13. // providing that this notice and the authors name is included. If 
  14. // the source code in  this file is used in any commercial application 
  15. // then a simple email would be nice.
  16. //
  17. // This file is provided "as is" with no expressed or implied warranty.
  18. // The author accepts no liability if it causes any damage whatsoever.
  19. // It's free - so you get what you pay for.
  20. //
  21.  
  22. #ifndef __LINECHARTCTRL_H__
  23. #define __LINECHARTCTRL_H__
  24.  
  25. #include <afxtempl.h>
  26.  
  27. class CLineChartItem:public CObject
  28. {
  29. public:
  30.     CLineChartItem() {;}
  31.  
  32.     COLORREF m_colorLine;
  33.     UINT     m_nLower;        // lower bounds
  34.     UINT     m_nUpper;        // upper bounds
  35.     
  36.     UINT     m_nPos;        // current position within bounds
  37.     UINT     m_nOldPos;        // last position within bounds
  38. };
  39.  
  40. typedef CTypedPtrArray <CObArray, CLineChartItem*> CItemArray;
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CLineChartCtrl window
  44.  
  45. class CLineChartCtrl : public CWnd
  46. {
  47. // Construction
  48. public:
  49.     static BOOL RegisterWndClass(HINSTANCE hInstance);
  50.  
  51.     CLineChartCtrl();
  52.     UINT m_nVertical;
  53.  
  54. // Attributes
  55. public:
  56.     CItemArray m_items;
  57.     UINT SetPos(int nIndex, UINT nPos);
  58.     void InvalidateCtrl();
  59.     void DrawSpike();
  60.  
  61.     // Operations
  62. public:
  63. // Overrides
  64.     // ClassWizard generated virtual function overrides
  65.     //{{AFX_VIRTUAL(CLineChartCtrl)
  66.     public:
  67.     //}}AFX_VIRTUAL
  68.  
  69. // Implementation
  70. public:
  71.     void Go();
  72.     BOOL Add(COLORREF color, UINT Upper, UINT Lower );
  73.     virtual ~CLineChartCtrl();
  74.  
  75.     // Generated message map functions
  76. protected:
  77.     //{{AFX_MSG(CLineChartCtrl)
  78.     afx_msg void OnPaint();
  79.     //}}AFX_MSG
  80.     DECLARE_MESSAGE_MAP()
  81.  
  82.     CDC      m_MemDC;
  83.     CBitmap  m_Bitmap;
  84. };
  85.  
  86. /////////////////////////////////////////////////////////////////////////////
  87. #endif
  88.