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.

147 lines
3.3 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 24/04/2000
  5. // Last modification: 08/10/2003
  6. // Project Intruder Position Indicator
  7. // SUBSYSTEM: Report view system
  8. // FILE: ReportView.h
  9. // AUTHOR: Chizhevskiy Sergey
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of class CReportView
  13. //----------------------------------------------------------------------------
  14. #ifndef __REPORTVIEW__H__INCLUDED__
  15. #define __REPORTVIEW__H__INCLUDED__
  16. #include "Profile.h"
  17. #include "..\LgLib\LgFileMap.h"
  18. #include "ImageWnd.h"
  19. struct IMAGE_FILE {
  20. HANDLE hFile;
  21. HANDLE hMap;
  22. LPBYTE pByte;
  23. DWORD nFirst;
  24. DWORD nCount;
  25. };
  26. typedef IMAGE_FILE* LPIMAGE_FILE;
  27. class CApplication;
  28. class CReportView {
  29. public:
  30. CReportView();
  31. ~CReportView();
  32. BOOL Create(HWND hWnd, CApplication *pApplication, CProfile *pProfile);
  33. void Close();
  34. void LoadDirectoryTree(HTREEITEM hParent, LPCTSTR pFolder);
  35. void OpenFolder(HTREEITEM hItem);
  36. BOOL IsWork();
  37. private:
  38. static DWORD CALLBACK ThreadProc_( LPVOID lpvParam );
  39. static BOOL CALLBACK WndProc_(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  40. private:
  41. void Empty();
  42. BOOL ImageDraw();
  43. BOOL PreviewDraw();
  44. void ScrollImage(INT nScrollCode, INT nPos);
  45. void ScrollPreview(INT nScrollCode, INT nPos);
  46. void AttachTextFile(LPCTSTR pName);
  47. void AttachLocatorFile(LPCTSTR pName);
  48. void AttachPreviewFile(LPCTSTR pName);
  49. void AttachImageFile(LPCTSTR pName);
  50. private:
  51. static DWORD CALLBACK EditStreamCallback( DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb );
  52. private:
  53. void OnPaint( HWND hWnd );
  54. void OnDraw( HDC hDC );
  55. void OnDrawTime( HDC hDC );
  56. void OnTimer();
  57. LRESULT OnEraseBackground( WPARAM, LPARAM );
  58. private:
  59. volatile BOOL m_bIsWorking;
  60. CProfile *m_pProfile;
  61. HMODULE m_hLibrary;
  62. HANDLE m_hThread;
  63. DWORD m_hThreadID;
  64. HWND m_hParentWnd;
  65. HWND m_hWnd;
  66. HWND m_hWndTreeReport;
  67. HWND m_hWndEditText;
  68. // HWND m_hWndStaticLocator;
  69. // HWND m_hWndStaticImage;
  70. // HWND m_hWndStaticPreview;
  71. HWND m_hWndScrollBarImage;
  72. HWND m_hWndScrollBarPreview;
  73. HWND m_hWndButtonClose;
  74. // HBITMAP m_hLocatorBitmap;
  75. // HBITMAP m_hLocatorMemBitmap;
  76. // HBITMAP m_hLocatorMemOldBitmap;
  77. // HDC m_hLocatorDC;
  78. // HDC m_hLocatorMemDC;
  79. // HBITMAP m_hPreviewBitmap;
  80. // HBITMAP m_hPreviewMemBitmap;
  81. // HBITMAP m_hPreviewMemOldBitmap;
  82. // DWORD m_nPreviewCount;
  83. // DWORD m_nPreviewCurrent;
  84. // HDC m_hPreviewDC;
  85. // HDC m_hPreviewMemDC;
  86. // HBITMAP m_hImageBitmap;
  87. // HDC m_hImageMemDC;
  88. // HDC m_hImageDC;
  89. // LPIMAGE_FILE m_pImageFile;
  90. // DWORD m_nImageCount;
  91. // DWORD m_nImageCurrent;
  92. // DWORD m_nImageFileCount;
  93. CApplication *m_pApplication;
  94. private:
  95. CLgArray<CLgFileMap*,CLgFileMap*> m_ImageArray;
  96. INT m_nImageCount;
  97. INT m_nImageCurrent;
  98. private:
  99. CLgFileMap m_PreviewFileMap;
  100. INT m_nJpegPreviewCount;
  101. INT m_nJpegPreviewCurrent;
  102. private:
  103. CImageWnd m_ImageWnd;
  104. CImageWnd m_LocatorWnd;
  105. CImageWnd m_PreviewWnd;
  106. };
  107. inline
  108. void CReportView::Close()
  109. {
  110. if(m_bIsWorking)
  111. ::PostThreadMessage(m_hThreadID, WM_QUIT, 0, 0);
  112. }
  113. inline
  114. BOOL CReportView::IsWork()
  115. {
  116. return m_bIsWorking;
  117. }
  118. #endif