00001
00002
00003
00004 #include "stdafx.h"
00005 #include "TransClient.h"
00006 #include "ConnectDialog.h"
00007
00008 #ifdef _DEBUG
00009 #define new DEBUG_NEW
00010 #undef THIS_FILE
00011 static char THIS_FILE[] = __FILE__;
00012 #endif
00013
00015
00016
00017
00018 CConnectDialog::CConnectDialog(CWnd* pParent )
00019 : CDialog(CConnectDialog::IDD, pParent)
00020 {
00021
00022 m_LocalHost = -1;
00023
00024 m_pIPAddrCtl = NULL;
00025 memset(m_nAddr, 0, 4);
00026 }
00027
00028
00029 void CConnectDialog::DoDataExchange(CDataExchange* pDX)
00030 {
00031 CDialog::DoDataExchange(pDX);
00032
00033 DDX_Radio(pDX, IDC_LOCAL, m_LocalHost);
00034
00035 if (m_pIPAddrCtl == NULL)
00036 m_pIPAddrCtl = (CIPAddrCtl*) GetDlgItem(IDC_ADDR);
00037 ASSERT(NULL != m_pIPAddrCtl);
00038
00039 DDX_IPAddr(pDX, IDC_ADDR, m_nAddr);
00040 }
00041
00042
00043 BEGIN_MESSAGE_MAP(CConnectDialog, CDialog)
00044
00045 ON_BN_CLICKED(IDC_REMOTE, OnRemote)
00046 ON_BN_CLICKED(IDC_LOCAL, OnLocal)
00047
00048 END_MESSAGE_MAP()
00049
00051
00052
00053 void CConnectDialog::OnOK()
00054 {
00055
00056 UpdateData(true);
00057 CDialog::OnOK();
00058 }
00059
00060 void CConnectDialog::OnRemote()
00061 {
00062
00063 GetDlgItem(IDC_ADDR)->EnableWindow(true);
00064 }
00065
00066 void CConnectDialog::OnLocal()
00067 {
00068
00069 GetDlgItem(IDC_ADDR)->EnableWindow(false);
00070 }
00071
00072 BOOL CConnectDialog::OnInitDialog()
00073 {
00074 CDialog::OnInitDialog();
00075
00076
00077
00078 m_LocalHost = 0;
00079 GetDlgItem(IDC_ADDR)->EnableWindow(false);
00080 UpdateData(false);
00081 return TRUE;
00082
00083 }