Source code of Windows XP (NT5)
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.

75 lines
2.1 KiB

  1. // ConfigDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "devctrl.h"
  5. #include "ConfigDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CConfigDlg dialog
  13. CConfigDlg::CConfigDlg(CWnd* pParent /*=NULL*/)
  14. : CDialog(CConfigDlg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CConfigDlg)
  17. m_Pipe1 = _T("");
  18. m_Pipe2 = _T("");
  19. m_Pipe3 = _T("");
  20. m_DefaultPipe = _T("");
  21. //}}AFX_DATA_INIT
  22. }
  23. void CConfigDlg::DoDataExchange(CDataExchange* pDX)
  24. {
  25. CDialog::DoDataExchange(pDX);
  26. //{{AFX_DATA_MAP(CConfigDlg)
  27. DDX_Control(pDX, IDC_STATUS_COMBOBOX, m_StatusCombobox);
  28. DDX_Control(pDX, IDC_INTERRUPT_COMBOBOX, m_InterruptCombobox);
  29. DDX_Control(pDX, IDC_BULK_OUT_COMBOBOX, m_BulkOutCombobox);
  30. DDX_Control(pDX, IDC_BULK_IN_COMBOBOX, m_BulkInCombobox);
  31. DDX_Text(pDX, IDC_PIPE1_NAME_EDITBOX, m_Pipe1);
  32. DDX_Text(pDX, IDC_PIPE2_NAME_EDITBOX, m_Pipe2);
  33. DDX_Text(pDX, IDC_PIPE3_NAME_EDITBOX, m_Pipe3);
  34. DDX_Text(pDX, IDC_DEFAULT_PIPE_NAME_EDITBOX, m_DefaultPipe);
  35. //}}AFX_DATA_MAP
  36. }
  37. BEGIN_MESSAGE_MAP(CConfigDlg, CDialog)
  38. //{{AFX_MSG_MAP(CConfigDlg)
  39. //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CConfigDlg message handlers
  43. BOOL CConfigDlg::OnInitDialog()
  44. {
  45. CDialog::OnInitDialog();
  46. m_StatusCombobox.SetCurSel(m_DeviceControl.StatusPipeIndex);
  47. m_InterruptCombobox.SetCurSel(m_DeviceControl.InterruptPipeIndex);
  48. m_BulkOutCombobox.SetCurSel(m_DeviceControl.BulkOutPipeIndex);
  49. m_BulkInCombobox.SetCurSel(m_DeviceControl.BulkInPipeIndex);
  50. return TRUE; // return TRUE unless you set the focus to a control
  51. // EXCEPTION: OCX Property Pages should return FALSE
  52. }
  53. void CConfigDlg::OnOK()
  54. {
  55. m_DeviceControl.StatusPipeIndex = m_StatusCombobox.GetCurSel();
  56. m_DeviceControl.InterruptPipeIndex = m_InterruptCombobox.GetCurSel();
  57. m_DeviceControl.BulkOutPipeIndex = m_BulkOutCombobox.GetCurSel();
  58. m_DeviceControl.BulkInPipeIndex = m_BulkInCombobox.GetCurSel();
  59. CDialog::OnOK();
  60. }