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.

103 lines
2.4 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: LgSubEventDlg.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of LgSubEventDlg.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "lglibreport.h"
  16. #include "LgSubEventDlg.h"
  17. #include "LgReportDlg.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CLgSubEventDlg dialog
  25. CLgSubEventDlg::CLgSubEventDlg(CWnd* pParent /*=NULL*/)
  26. : CDialog(CLgSubEventDlg::IDD, pParent)
  27. {
  28. //{{AFX_DATA_INIT(CLgSubEventDlg)
  29. // NOTE: the ClassWizard will add member initialization here
  30. //}}AFX_DATA_INIT
  31. m_bListUpdate = FALSE;
  32. m_pReportDlg = NULL;
  33. }
  34. void CLgSubEventDlg::DoDataExchange(CDataExchange* pDX)
  35. {
  36. CDialog::DoDataExchange(pDX);
  37. //{{AFX_DATA_MAP(CLgSubEventDlg)
  38. DDX_Control(pDX, IDC_LIST_EVENT, m_ListEvent);
  39. //}}AFX_DATA_MAP
  40. }
  41. BEGIN_MESSAGE_MAP(CLgSubEventDlg, CDialog)
  42. //{{AFX_MSG_MAP(CLgSubEventDlg)
  43. ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST_EVENT, OnItemchangedListEvent)
  44. ON_WM_SIZE()
  45. //}}AFX_MSG_MAP
  46. END_MESSAGE_MAP()
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CLgSubEventDlg message handlers
  49. void CLgSubEventDlg::OnItemchangedListEvent(NMHDR* pNMHDR, LRESULT* pResult)
  50. {
  51. NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
  52. if( !m_bListUpdate )
  53. {
  54. m_bListUpdate = TRUE;
  55. m_pReportDlg->OnChangeEvent( pNMListView->iItem );
  56. m_bListUpdate = FALSE;
  57. }
  58. *pResult = 0;
  59. }
  60. BOOL CLgSubEventDlg::Create(CLgReportDlg *pReportDlg, CWnd *pParentWnd, CRect *pRect )
  61. {
  62. m_pReportDlg = pReportDlg;
  63. if( !CDialog::Create( IDD, pParentWnd ) )
  64. return FALSE;
  65. ShowWindow( SW_SHOW );
  66. CRect rect;
  67. if( pRect )
  68. rect = *pRect;
  69. else
  70. pParentWnd->GetClientRect( &rect );
  71. MoveWindow( &rect );
  72. return TRUE;
  73. }
  74. void CLgSubEventDlg::OnSize(UINT nType, int cx, int cy)
  75. {
  76. CDialog::OnSize(nType, cx, cy);
  77. if( m_ListEvent.GetSafeHwnd() )
  78. m_ListEvent.MoveWindow( 0, 0, cx, cy );
  79. }