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.

110 lines
2.8 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: BoardReceiverSeekDlg.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of BoardReceiverSeekDlg.cpp
  13. //----------------------------------------------------------------------------
  14. // BoardReceiverSeekDlg.cpp : implementation file
  15. //
  16. #include "stdafx.h"
  17. #include "boardreceiver.h"
  18. #include "BoardReceiverSeekDlg.h"
  19. /*
  20. #ifdef _DEBUG
  21. #define new DEBUG_NEW
  22. #undef THIS_FILE
  23. static char THIS_FILE[] = __FILE__;
  24. #endif
  25. */
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CBoardReceiverSeekDlg dialog
  28. CBoardReceiverSeekDlg::CBoardReceiverSeekDlg(CWnd* pParent /*=NULL*/)
  29. : CDialog(CBoardReceiverSeekDlg::IDD, pParent)
  30. {
  31. //{{AFX_DATA_INIT(CBoardReceiverSeekDlg)
  32. m_nRadio = 0;
  33. //}}AFX_DATA_INIT
  34. }
  35. void CBoardReceiverSeekDlg::DoDataExchange(CDataExchange* pDX)
  36. {
  37. CDialog::DoDataExchange(pDX);
  38. //{{AFX_DATA_MAP(CBoardReceiverSeekDlg)
  39. DDX_Control(pDX, IDC_SPIN_STEP, m_SpinStep);
  40. DDX_Control(pDX, IDC_EDIT_STEP, m_EditStep);
  41. DDX_Control(pDX, IDC_DATETIMEPICKER_TIME, m_DateTime);
  42. DDX_Radio(pDX, IDC_RADIO_STEP, m_nRadio);
  43. //}}AFX_DATA_MAP
  44. }
  45. BEGIN_MESSAGE_MAP(CBoardReceiverSeekDlg, CDialog)
  46. //{{AFX_MSG_MAP(CBoardReceiverSeekDlg)
  47. ON_BN_CLICKED(IDC_RADIO_STEP, OnRadioButton)
  48. ON_BN_CLICKED(IDC_RADIO_TIME, OnRadioButton)
  49. ON_BN_CLICKED(IDC_BUTTON_GOTO, OnButtonGoto)
  50. ON_BN_CLICKED(IDC_BUTTON_RUNTO, OnButtonRunto)
  51. //}}AFX_MSG_MAP
  52. END_MESSAGE_MAP()
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CBoardReceiverSeekDlg message handlers
  55. BOOL CBoardReceiverSeekDlg::OnInitDialog()
  56. {
  57. CDialog::OnInitDialog();
  58. m_DateTime.SendMessage( DTM_SETFORMAT, 0, (LONG)_T("MMM' 'dd', 'yyy' 'HH':'mm':'ss") );
  59. m_SpinStep.SetRange32( 1, INT_MAX );
  60. m_SpinStep.SendMessage( UDM_SETPOS32, 0, (LONG)m_nStep.QuadPart );
  61. OnRadioButton();
  62. return TRUE; // return TRUE unless you set the focus to a control
  63. // EXCEPTION: OCX Property Pages should return FALSE
  64. }
  65. void CBoardReceiverSeekDlg::OnRadioButton()
  66. {
  67. UpdateData();
  68. m_DateTime.EnableWindow( m_nRadio == 1 );
  69. m_EditStep.EnableWindow( m_nRadio == 0 );
  70. m_SpinStep.EnableWindow( m_nRadio == 0 );
  71. }
  72. void CBoardReceiverSeekDlg::OnButtonGoto()
  73. {
  74. if( m_nRadio == 0 )
  75. {
  76. m_nStep.QuadPart = m_SpinStep.SendMessage( UDM_GETPOS32, 0, 0 );
  77. }
  78. m_bRuntoOrGoto = FALSE;
  79. CDialog::OnOK();
  80. }
  81. void CBoardReceiverSeekDlg::OnButtonRunto()
  82. {
  83. if( m_nRadio == 0 )
  84. {
  85. m_nStep.QuadPart = m_SpinStep.SendMessage( UDM_GETPOS32, 0, 0 );
  86. }
  87. m_bRuntoOrGoto = TRUE;
  88. CDialog::OnOK();
  89. }