graphctl.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * ReactOS Task Manager
  3. *
  4. * graphctl.h
  5. *
  6. * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  21. */
  22. #ifndef __GRAPH_CTRL_H__
  23. #define __GRAPH_CTRL_H__
  24. #define MAX_PLOTS 4
  25. #define MAX_CTRLS 4
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. typedef struct
  30. {
  31. int m_nShiftPixels; /* amount to shift with each new point */
  32. int m_nYDecimals;
  33. char m_strXUnitsString[50];
  34. char m_strYUnitsString[50];
  35. COLORREF m_crBackColor; /* background color */
  36. COLORREF m_crGridColor; /* grid color */
  37. COLORREF m_crPlotColor[MAX_PLOTS]; /* data color */
  38. double m_dCurrentPosition[MAX_PLOTS]; /* current position */
  39. double m_dPreviousPosition[MAX_PLOTS]; /* previous position */
  40. /* those were protected fields */
  41. int m_nHalfShiftPixels;
  42. int m_nPlotShiftPixels;
  43. int m_nClientHeight;
  44. int m_nClientWidth;
  45. int m_nPlotHeight;
  46. int m_nPlotWidth;
  47. double m_dLowerLimit; /* lower bounds */
  48. double m_dUpperLimit; /* upper bounds */
  49. double m_dRange;
  50. double m_dVerticalFactor;
  51. HWND m_hWnd;
  52. HWND m_hParentWnd;
  53. HDC m_dcGrid;
  54. HDC m_dcPlot;
  55. HBITMAP m_bitmapOldGrid;
  56. HBITMAP m_bitmapOldPlot;
  57. HBITMAP m_bitmapGrid;
  58. HBITMAP m_bitmapPlot;
  59. HBRUSH m_brushBack;
  60. HPEN m_penPlot[MAX_PLOTS];
  61. RECT m_rectClient;
  62. RECT m_rectPlot;
  63. } TGraphCtrl;
  64. extern WNDPROC OldGraphCtrlWndProc;
  65. double GraphCtrl_AppendPoint(TGraphCtrl* this,
  66. double dNewPoint0, double dNewPoint1,
  67. double dNewPoint2, double dNewPoint3);
  68. void GraphCtrl_Create(TGraphCtrl* this, HWND hWnd, HWND hParentWnd, UINT nID);
  69. void GraphCtrl_Reset(TGraphCtrl* this);
  70. void GraphCtrl_SetBackgroundColor(TGraphCtrl* this, COLORREF
  71. color);
  72. void GraphCtrl_SetGridColor(TGraphCtrl* this, COLORREF color);
  73. void GraphCtrl_SetPlotColor(TGraphCtrl* this, int plot, COLORREF
  74. color);
  75. void GraphCtrl_SetRange(TGraphCtrl* this, double dLower, double
  76. dUpper, int nDecimalPlaces);
  77. INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #endif /* __GRAPH_CTRL_H__ */