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.

85 lines
1.9 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: 13/04/2001
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: TroubleDlg.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of TroubleDlg.cpp
  13. //----------------------------------------------------------------------------
  14. // TroubleDlg.cpp : implementation file
  15. //
  16. #include "stdafx.h"
  17. #include "chicago.h"
  18. #include "TroubleDlg.h"
  19. #include "Version.h"
  20. #ifdef _DEBUG
  21. #define new DEBUG_NEW
  22. #undef THIS_FILE
  23. static char THIS_FILE[] = __FILE__;
  24. #endif
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CTroubleDlg dialog
  27. CTroubleDlg::CTroubleDlg(CWnd* pParent /*=NULL*/)
  28. : CDialog(CTroubleDlg::IDD, pParent)
  29. {
  30. //{{AFX_DATA_INIT(CTroubleDlg)
  31. // NOTE: the ClassWizard will add member initialization here
  32. //}}AFX_DATA_INIT
  33. }
  34. void CTroubleDlg::DoDataExchange(CDataExchange* pDX)
  35. {
  36. CDialog::DoDataExchange(pDX);
  37. //{{AFX_DATA_MAP(CTroubleDlg)
  38. DDX_Control(pDX, IDC_STATIC_TEXT, m_Text);
  39. //}}AFX_DATA_MAP
  40. }
  41. BEGIN_MESSAGE_MAP(CTroubleDlg, CDialog)
  42. //{{AFX_MSG_MAP(CTroubleDlg)
  43. ON_WM_TIMER()
  44. //}}AFX_MSG_MAP
  45. END_MESSAGE_MAP()
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CTroubleDlg message handlers
  48. void CTroubleDlg::SetTroubleText(LPSTR pText)
  49. {
  50. m_strText = pText;
  51. }
  52. BOOL CTroubleDlg::OnInitDialog()
  53. {
  54. CDialog::OnInitDialog();
  55. m_Text.SetWindowText( m_strText );
  56. return TRUE; // return TRUE unless you set the focus to a control
  57. }
  58. void CTroubleDlg::OnTimer(UINT nIDEvent)
  59. {
  60. if( ::GetTickCount() >= m_dwStartTime )
  61. EndDialog( IDCANCEL );
  62. else
  63. CDialog::OnTimer(nIDEvent);
  64. }
  65. int CTroubleDlg::DoModal()
  66. {
  67. m_dwStartTime = ::GetTickCount() + 10000UL;
  68. return CDialog::DoModal();
  69. }