// AddNodeDlg.cpp : implementation file // #include "stdafx.h" #include "Perfstat_UI_Final.h" #include "AddNodeDlg.h" #include "afxdialogex.h" // CAddNodeDlg dialog IMPLEMENT_DYNAMIC(CAddNodeDlg, CDialogEx) CAddNodeDlg::CAddNodeDlg(CWnd* pParent /*=NULL*/) : CDialogEx(CAddNodeDlg::IDD, pParent) { m_pToolTipCtrl = NULL; } CAddNodeDlg::~CAddNodeDlg() { } void CAddNodeDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); DDX_Control(pDX, IDC_EDIT_HOST_NAME, m_editName); DDX_Control(pDX, IDC_STATIC_IP, m_staticIP); DDX_Control(pDX, IDC_STATIC_HOST_NAME, m_staticHostName); DDX_Control(pDX, IDC_EDIT_IP, m_editIP); } BEGIN_MESSAGE_MAP(CAddNodeDlg, CDialogEx) ON_EN_CHANGE(IDC_EDIT_IP, &CAddNodeDlg::OnEnChangeEditIp) ON_EN_CHANGE(IDC_EDIT_HOST_NAME, &CAddNodeDlg::OnEnChangeEditHostName) END_MESSAGE_MAP() // CAddNodeDlg message handlers BOOL CAddNodeDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // TODO: Add extra initialization here EnableToolTips(); m_pToolTipCtrl = new CToolTipCtrl; m_pToolTipCtrl->Create( this ); CString strToolTip; strToolTip.LoadStringW(IDS_TOOLTIP_NODE_ADD_IP); m_pToolTipCtrl->AddTool( &m_staticIP, strToolTip.AllocSysString()); strToolTip.LoadStringW(IDS_TOOLTIP_NODE_ADD_HOSTNAME); m_pToolTipCtrl->AddTool( &m_staticHostName, strToolTip.AllocSysString()); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } BOOL CAddNodeDlg::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); } CString CAddNodeDlg::GetIP() const { return m_strIP; } CString CAddNodeDlg::GetHostName() const { return m_strHostName; } void CAddNodeDlg::OnEnChangeEditIp() { // 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_IP, m_strIP); } void CAddNodeDlg::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); }