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.

132 lines
3.5 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: 04/11/2002
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: MapWnd.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of MapWnd.h
  13. //----------------------------------------------------------------------------
  14. #if !defined(AFX_MAPSITE_H__9B1BD4F4_71EC_11D4_A1EF_0010B55CB330__INCLUDED_)
  15. #define AFX_MAPSITE_H__9B1BD4F4_71EC_11D4_A1EF_0010B55CB330__INCLUDED_
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif // _MSC_VER > 1000
  19. // MapSite.h : header file
  20. //
  21. #include "..\DLIB\MapData.h"
  22. #include "..\DLIB\Visual.h" // Added by ClassView
  23. #include "..\DLIB\BackgroundDrawThread.h"
  24. class CMapWnd : public CWnd
  25. {
  26. // Construction
  27. public:
  28. CMapWnd();
  29. // Attributes
  30. public:
  31. // Operations
  32. public:
  33. // Overrides
  34. // ClassWizard generated virtual function overrides
  35. //{{AFX_VIRTUAL(CMapWnd)
  36. public:
  37. virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
  38. //}}AFX_VIRTUAL
  39. // Implementation
  40. public:
  41. void SetActive( CVisual *pVisual );
  42. SDPOINT GetMapShift() { return m_MapShift; }
  43. // void SetMapShift( DPOINT& mapShift ) { m_MapShift = mapShift; PrepareOverlay(); }
  44. double GetMapScale() { return m_MapScale; }
  45. // void SetMapScale( double mapScale) { m_MapScale = mapScale; PrepareOverlay(); }
  46. void SetMapShiftScale( SDPOINT& mapShift, double mapScale) { m_MapShift = mapShift; m_MapScale = mapScale; PrepareOverlay(); }
  47. void SetMapData( CMapData* pMapData );
  48. CMapData *GetMapData() { return m_pMapData; }
  49. BOOL& BigImage(){ return m_bBigSize; }
  50. virtual ~CMapWnd();
  51. // Generated message map functions
  52. private:
  53. friend static DWORD CALLBACK ThreadProcPrepareOverlay( LPVOID lpvParam ) { return ((CMapWnd*)lpvParam)->ThreadProc(); }
  54. DWORD ThreadProc();
  55. struct THREAD
  56. {
  57. CBitmap* pOverlayBitmapOld;
  58. CBitmap OverlayBitmap;
  59. CDC OverlayDC;
  60. HANDLE hEventQuit;
  61. HANDLE hEventStart;
  62. HANDLE hEventComplette;
  63. CRect ViewRect;
  64. SDPOINT MapShift;
  65. double MapScale;
  66. CRect RestartViewRect;
  67. SDPOINT RestartMapShift;
  68. double RestartMapScale;
  69. BOOL bNeedCopy;
  70. BOOL bNeedRestart;
  71. BOOL bComplette;
  72. } m_ThreadData;
  73. HANDLE m_hThread;
  74. private:
  75. CVisual *m_pActive;
  76. CMenu m_PopupMenu;
  77. BOOL m_bFullRepaint;
  78. LRESULT OnWMSensorUpdate( WPARAM wParam, LPARAM lParam );
  79. void PrepareOverlay();
  80. CBitmap* m_pOverlayBitmapOld;
  81. CFont* m_pOverlayFontOld;
  82. CBitmap m_OverlayBitmap;
  83. CDC m_OverlayDC;
  84. BOOL m_bBigSize;
  85. BOOL m_bInverse;
  86. SDPOINT m_MapShift;
  87. double m_MapScale;
  88. CMapData* m_pMapData;
  89. CRect m_ClientRect;
  90. CSensor *m_pSensor;
  91. CBackgroundDrawThread m_MapDrawThread;
  92. protected:
  93. //{{AFX_MSG(CMapWnd)
  94. afx_msg void OnPaint();
  95. afx_msg void OnTimer(UINT nIDEvent);
  96. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  97. afx_msg void OnSize(UINT nType, int cx, int cy);
  98. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  99. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  100. //}}AFX_MSG
  101. DECLARE_MESSAGE_MAP()
  102. };
  103. /////////////////////////////////////////////////////////////////////////////
  104. //{{AFX_INSERT_LOCATION}}
  105. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  106. #endif // !defined(AFX_MAPSITE_H__9B1BD4F4_71EC_11D4_A1EF_0010B55CB330__INCLUDED_)