Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.6 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: TroubleListWnd.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of TroubleListWnd.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __TROUBLE__LIST__WND__H__INCLUDED__
  15. #define __TROUBLE__LIST__WND__H__INCLUDED__
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #include "..\..\LgLib\MFC\ListWnd.h"
  20. #include "..\DLIB\SensorArray.h" // Added by ClassView
  21. #include "..\..\LgLib\MFC\MemoryDC.h" // Added by ClassView
  22. #include "..\DLIB\Background.h" // Added by ClassView
  23. #include "..\..\LgLib\UIMap\LgUIMapBackground.h"
  24. class CTroubleListWnd : public CLgListWnd
  25. {
  26. public:
  27. CTroubleListWnd();
  28. virtual ~CTroubleListWnd();
  29. public:
  30. virtual BOOL Create( CWnd *pParentWnd, int x, int y, int nWidth, int nHeight, CLgUIMapBackground* pBackground );
  31. public:
  32. void SetItemImage( CSensor*, HBITMAP );
  33. void SetSensorArray( CSensorArray *pSensorArray ) { m_pSensorArray = pSensorArray; }
  34. void UpdateInfo( BOOL bOdd );
  35. //{{AFX_VIRTUAL(CTroubleListWnd)
  36. //}}AFX_VIRTUAL
  37. protected:
  38. //{{AFX_MSG(CTroubleListWnd)
  39. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  40. //}}AFX_MSG
  41. DECLARE_MESSAGE_MAP()
  42. public:
  43. enum{ TROUBLE_IMAGE_SKIP = 5, TROUBLE_IMAGE_TIMEOUT = 1000UL };
  44. protected:
  45. enum{ TT_SENSOR, TT_WARNING };
  46. typedef struct TROUBLE
  47. {
  48. TROUBLE()
  49. {
  50. bImage = FALSE;
  51. // reset images
  52. memset( pBitmap, 0, sizeof(pBitmap) );
  53. nBitmapCount = 0;
  54. nBitmapIndexAdd = 0;
  55. nBitmapIndexView = 0;
  56. dwImageTime = 0;
  57. nImageSkip = 0;
  58. }
  59. int nType;
  60. // union
  61. // {
  62. struct
  63. {
  64. CSensor *pSensor;
  65. CLgMemoryDC dcDraw;
  66. HBITMAP pBitmap[ 10 ];
  67. INT nBitmapCount;
  68. INT nBitmapIndexAdd;
  69. INT nBitmapIndexView;
  70. DWORD dwImageTime;
  71. INT nImageSkip;
  72. };
  73. struct
  74. {
  75. CString strLabel;
  76. CString strText;
  77. };
  78. // };
  79. BOOL bImage;
  80. }TROUBLE, *PTROUBLE;
  81. protected:
  82. virtual void OnItemMove( void* pItem, CRect *pRect, BOOL bShow, BOOL bActive );
  83. virtual void OnItemRemove( void *pItem );
  84. virtual void OnItemDraw( CDC *pDC, CRect *pRect, void *pItem, BOOL bActive );
  85. protected:
  86. CLgMemoryDC m_MemoryDC;
  87. CSensorArray *m_pSensorArray;
  88. BOOL m_bOddUpdate;
  89. CRect m_MinimapRect;
  90. private:
  91. HICON m_hIconPower;
  92. };
  93. //{{AFX_INSERT_LOCATION}}
  94. #endif