// AddSwitchDlg.cpp : implementation file // #include "stdafx.h" #include "Perfstat_UI_Final.h" #include "AddSwitchDlg.h" #include "afxdialogex.h" // CAddSwitchDlg dialog IMPLEMENT_DYNAMIC(CAddSwitchDlg, CDialogEx) CAddSwitchDlg::CAddSwitchDlg(CWnd* pParent /*=NULL*/) : CDialogEx(CAddSwitchDlg::IDD, pParent) { m_pToolTipCtrl = NULL; } CAddSwitchDlg::~CAddSwitchDlg() { } void CAddSwitchDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAddSwitchDlg, CDialogEx) ON_EN_CHANGE(IDC_EDIT_SWITCH_IP, &CAddSwitchDlg::OnEnChangeEditSwitchIp) ON_EN_CHANGE(IDC_EDIT_SWITCH_HOSTNAME, &CAddSwitchDlg::OnEnChangeEditSwitchHostname) ON_EN_CHANGE(IDC_EDIT_SWITCH_TYPE, &CAddSwitchDlg::OnEnChangeEditSwitchType) ON_EN_CHANGE(IDC_EDIT_SWITCH_USERNAME, &CAddSwitchDlg::OnEnChangeEditSwitchUsername) ON_EN_CHANGE(IDC_EDIT_SWITCH_PASSWORD, &CAddSwitchDlg::OnEnChangeEditSwitchPassword) END_MESSAGE_MAP() // CAddSwitchDlg message handlers void CAddSwitchDlg::OnEnChangeEditSwitchIp() { // 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_SWITCH_IP,m_strIP); } void CAddSwitchDlg::OnEnChangeEditSwitchHostname() { // 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_SWITCH_HOSTNAME,m_strHostName); } void CAddSwitchDlg::OnEnChangeEditSwitchType() { // 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_SWITCH_TYPE,m_strType); } void CAddSwitchDlg::OnEnChangeEditSwitchUsername() { // 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_SWITCH_USERNAME,m_strUserName); } void CAddSwitchDlg::OnEnChangeEditSwitchPassword() { // 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_SWITCH_PASSWORD,m_strPassword); } BOOL CAddSwitchDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // TODO: Add extra initialization here EnableToolTips(); m_pToolTipCtrl = new CToolTipCtrl; m_pToolTipCtrl->Create( this ); CString strToolTip; CStatic* staticCtrl = NULL; strToolTip.LoadStringW(IDS_TOOLTIP_SWITCH_IP); staticCtrl = (CStatic*)(GetDlgItem(IDC_STATIC_IP)); m_pToolTipCtrl->AddTool( staticCtrl, strToolTip.AllocSysString()); staticCtrl = (CStatic*)(GetDlgItem(IDC_STATIC_SWITCH_HOSTNAME)); strToolTip.LoadStringW(IDS_TOOLTIP_SWITCH_HOSTNAME); m_pToolTipCtrl->AddTool( staticCtrl, strToolTip.AllocSysString()); staticCtrl = (CStatic*)(GetDlgItem(IDC_STATIC_USER)); strToolTip.LoadStringW(IDS_TOOLTIP_SWITCH_USERNAME); m_pToolTipCtrl->AddTool( staticCtrl, strToolTip.AllocSysString()); staticCtrl = (CStatic*)(GetDlgItem(IDC_STATIC_TYPE)); strToolTip.LoadStringW(IDS_TOOLTIP_SWITCH_TYPE); m_pToolTipCtrl->AddTool( staticCtrl, strToolTip.AllocSysString()); staticCtrl = (CStatic*)(GetDlgItem(IDC_STATIC_PASSWORD)); strToolTip.LoadStringW(IDS_TOOLTIP_SWITCH_PASSWORD); m_pToolTipCtrl->AddTool( staticCtrl, strToolTip.AllocSysString()); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } BOOL CAddSwitchDlg::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 CAddSwitchDlg::GetIP() const { return m_strIP; } CString CAddSwitchDlg::GetUserName() const { return m_strUserName; } CString CAddSwitchDlg::GetHostName() const { return m_strHostName; } CString CAddSwitchDlg::GetPassword() const { return m_strPassword; } CString CAddSwitchDlg:: GetType() const { return m_strType; }