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.

72 lines
2.0 KiB

  1. // ConnectOneDialog.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "KeyRing.h"
  5. #include "ConctDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CConnectOneDialog dialog
  13. CConnectOneDialog::CConnectOneDialog(CWnd* pParent /*=NULL*/)
  14. : CDialog(CConnectOneDialog::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CConnectOneDialog)
  17. m_ServerName = _T("");
  18. //}}AFX_DATA_INIT
  19. }
  20. void CConnectOneDialog::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(CConnectOneDialog)
  24. DDX_Control(pDX, IDOK, m_btnOK);
  25. DDX_Text(pDX, IDC_CONNECT_ServerName, m_ServerName);
  26. DDV_MaxChars(pDX, m_ServerName, 256);
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(CConnectOneDialog, CDialog)
  30. //{{AFX_MSG_MAP(CConnectOneDialog)
  31. ON_EN_CHANGE(IDC_CONNECT_ServerName, OnChangeCONNECTServerName)
  32. //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CConnectOneDialog message handlers
  36. //----------------------------------------------------------------
  37. // override virtual oninitdialog
  38. BOOL CConnectOneDialog::OnInitDialog( )
  39. {
  40. // call the base oninit
  41. CDialog::OnInitDialog();
  42. // we start with no password, so diable the ok window
  43. m_btnOK.EnableWindow( FALSE );
  44. // return 0 to say we set the default item
  45. // return 1 to just select the default default item
  46. return 1;
  47. }
  48. //----------------------------------------------------------------
  49. void CConnectOneDialog::OnChangeCONNECTServerName()
  50. {
  51. // if there is no server, disable the ok button.
  52. // otherwise, enable it
  53. UpdateData( TRUE );
  54. m_btnOK.EnableWindow( !m_ServerName.IsEmpty() );
  55. }
  56. //----------------------------------------------------------------