Main Page | File List

ConnectDialog.cpp

00001 // ConnectDialog.cpp : implementation file
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 // CConnectDialog dialog
00016 
00017 
00018 CConnectDialog::CConnectDialog(CWnd* pParent /*=NULL*/)
00019         : CDialog(CConnectDialog::IDD, pParent)
00020 {
00021         //{{AFX_DATA_INIT(CConnectDialog)
00022         m_LocalHost = -1;
00023         //}}AFX_DATA_INIT
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         //{{AFX_DATA_MAP(CConnectDialog)
00033         DDX_Radio(pDX, IDC_LOCAL, m_LocalHost);
00034         //}}AFX_DATA_MAP
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         //{{AFX_MSG_MAP(CConnectDialog)
00045         ON_BN_CLICKED(IDC_REMOTE, OnRemote)
00046         ON_BN_CLICKED(IDC_LOCAL, OnLocal)
00047         //}}AFX_MSG_MAP
00048 END_MESSAGE_MAP()
00049 
00051 // CConnectDialog message handlers
00052 
00053 void CConnectDialog::OnOK() 
00054 {
00055         // TODO: Add extra validation here
00056         UpdateData(true);
00057         CDialog::OnOK();
00058 }
00059 
00060 void CConnectDialog::OnRemote() 
00061 {
00062         // TODO: Add your control notification handler code here
00063         GetDlgItem(IDC_ADDR)->EnableWindow(true);
00064 }
00065 
00066 void CConnectDialog::OnLocal() 
00067 {
00068         // TODO: Add your control notification handler code here
00069         GetDlgItem(IDC_ADDR)->EnableWindow(false);      
00070 }
00071 
00072 BOOL CConnectDialog::OnInitDialog() 
00073 {
00074         CDialog::OnInitDialog();
00075         
00076         // TODO: Add extra initialization here
00077 
00078         m_LocalHost = 0;
00079         GetDlgItem(IDC_ADDR)->EnableWindow(false);      
00080         UpdateData(false);
00081         return TRUE;  // return TRUE unless you set the focus to a control
00082                       // EXCEPTION: OCX Property Pages should return FALSE
00083 }

Generated on Mon May 8 22:27:08 2006 by  doxygen 1.3.9.1