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.

99 lines
2.3 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: LgSubTreeDlg.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of LgSubTreeDlg.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "lglibreport.h"
  16. #include "LgSubTreeDlg.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. CLgSubTreeDlg::CLgSubTreeDlg(CWnd* pParent /*=NULL*/)
  24. : CDialog(CLgSubTreeDlg::IDD, pParent)
  25. {
  26. //{{AFX_DATA_INIT(CLgSubTreeDlg)
  27. // NOTE: the ClassWizard will add member initialization here
  28. //}}AFX_DATA_INIT
  29. m_bTreeUpdate = FALSE;
  30. m_pReportDlg = NULL;
  31. }
  32. void CLgSubTreeDlg::DoDataExchange(CDataExchange* pDX)
  33. {
  34. CDialog::DoDataExchange(pDX);
  35. //{{AFX_DATA_MAP(CLgSubTreeDlg)
  36. DDX_Control(pDX, IDC_TREE_REPORT, m_TreeReport);
  37. //}}AFX_DATA_MAP
  38. }
  39. BEGIN_MESSAGE_MAP(CLgSubTreeDlg, CDialog)
  40. //{{AFX_MSG_MAP(CLgSubTreeDlg)
  41. ON_NOTIFY(TVN_SELCHANGED, IDC_TREE_REPORT, OnSelchangedTreeReport)
  42. ON_WM_SIZE()
  43. //}}AFX_MSG_MAP
  44. END_MESSAGE_MAP()
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CLgSubTreeDlg message handlers
  47. void CLgSubTreeDlg::OnSelchangedTreeReport(NMHDR* pNMHDR, LRESULT* pResult)
  48. {
  49. NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
  50. if( !m_bTreeUpdate )
  51. {
  52. m_bTreeUpdate = TRUE;
  53. m_pReportDlg->OnChangeTree( pNMTreeView->itemNew.hItem );
  54. m_bTreeUpdate = FALSE;
  55. }
  56. *pResult = 0;
  57. }
  58. BOOL CLgSubTreeDlg::Create( CLgReportDlg *pReportDlg, CWnd *pParentWnd, CRect *pRect )
  59. {
  60. m_pReportDlg = pReportDlg;
  61. if( !CDialog::Create( IDD, pParentWnd ) )
  62. return FALSE;
  63. ShowWindow( SW_SHOW );
  64. CRect rect;
  65. if( pRect )
  66. rect = *pRect;
  67. else
  68. pParentWnd->GetClientRect( &rect );
  69. MoveWindow( &rect );
  70. return TRUE;
  71. }
  72. void CLgSubTreeDlg::OnSize(UINT nType, int cx, int cy)
  73. {
  74. CDialog::OnSize(nType, cx, cy);
  75. if( m_TreeReport.GetSafeHwnd() )
  76. m_TreeReport.MoveWindow( 0, 0, cx, cy );
  77. }