// AddRemoteHostDlg.cpp : implementation file // #include "stdafx.h" #include "Perfstat_UI_Final.h" #include "AddRemoteHostDlg.h" #include "afxdialogex.h" // CAddRemoteHostDlg dialog IMPLEMENT_DYNAMIC(CAddRemoteHostDlg, CDialogEx) CAddRemoteHostDlg::CAddRemoteHostDlg(CWnd* pParent /*=NULL*/) : CDialogEx(CAddRemoteHostDlg::IDD, pParent) { m_pToolTipCtrl = NULL; } CAddRemoteHostDlg::~CAddRemoteHostDlg() { } void CAddRemoteHostDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); DDX_Control(pDX, IDC_STATIC_IP, m_staticIP); DDX_Control(pDX, IDC_STATIC_HOST_NAME, m_staticHostName); DDX_Control(pDX, IDC_STATIC_USER_NAME, m_staticUser); DDX_Control(pDX, IDC_STATIC_PASSWORD, m_staticPassword); } BEGIN_MESSAGE_MAP(CAddRemoteHostDlg, CDialogEx) ON_EN_CHANGE(IDC_EDIT_HOST_IP, &CAddRemoteHostDlg::OnEnChangeEditHostIp) ON_EN_CHANGE(IDC_EDIT_HOST_NAME, &CAddRemoteHostDlg::OnEnChangeEditHostName) ON_EN_CHANGE(IDC_EDIT_USER_NAME, &CAddRemoteHostDlg::OnEnChangeEditUserName) ON_EN_CHANGE(IDC_EDIT_PASSWORD, &CAddRemoteHostDlg::OnEnChangeEditPassword) END_MESSAGE_MAP() // CAddRemoteHostDlg message handlers BOOL CAddRemoteHostDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if (m_pToolTipCtrl != NULL) { m_pToolTipCtrl->RelayEvent(pMsg); } return CDialogEx::PreTranslateMessage(pMsg); } BOOL CAddRemoteHostDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // TODO: Add extra initialization here EnableToolTips(); m_pToolTipCtrl = new CToolTipCtrl; m_pToolTipCtrl->Create( this ); CString strToolTip; strToolTip.LoadStringW(IDS_TOOLTIP_HOST_ADD_IP); m_pToolTipCtrl->AddTool( &m_staticIP, strToolTip.AllocSysString()); strToolTip.LoadStringW(IDS_TOOLTIP_HOST_ADD_NAME); m_pToolTipCtrl->AddTool( &m_staticHostName, strToolTip.AllocSysString()); strToolTip.LoadStringW(IDS_TOOLTIP_HOST_USER_NAME); m_pToolTipCtrl->AddTool( &m_staticUser, strToolTip.AllocSysString()); strToolTip.LoadStringW(IDS_TOOLTIP_HOST_PASSWORD); m_pToolTipCtrl->AddTool( &m_staticPassword, strToolTip.AllocSysString()); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } CString CAddRemoteHostDlg::GetIP() const { return m_strIP; } CString CAddRemoteHostDlg::GetUserName() const { return m_strUserName; } CString CAddRemoteHostDlg::GetHostName() const { return m_strHostName; } CString CAddRemoteHostDlg::GetPassword() const { return m_strPassword; } void CAddRemoteHostDlg::OnEnChangeEditHostIp() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialogEx::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. // TODO: Add your control notification handler code here GetDlgItemText(IDC_EDIT_HOST_IP,m_strIP); } void CAddRemoteHostDlg::OnEnChangeEditHostName() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialogEx::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. // TODO: Add your control notification handler code here GetDlgItemText(IDC_EDIT_HOST_NAME,m_strHostName); } void CAddRemoteHostDlg::OnEnChangeEditUserName() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialogEx::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. // TODO: Add your control notification handler code here GetDlgItemText(IDC_EDIT_USER_NAME,m_strUserName); } void CAddRemoteHostDlg::OnEnChangeEditPassword() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialogEx::OnInitDialog() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask. // TODO: Add your control notification handler code here GetDlgItemText(IDC_EDIT_PASSWORD,m_strPassword); }