⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 settingdlg.cpp

📁 本程序是一个宾馆程控电话系统
💻 CPP
字号:
// SettingDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Tel2006.h"
#include "SettingDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSettingDlg dialog


CSettingDlg::CSettingDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSettingDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSettingDlg)
	//}}AFX_DATA_INIT
}


void CSettingDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSettingDlg)
	DDX_Control(pDX, IDC_COMBO_CONBAUD, m_comboConBaud);
	DDX_Control(pDX, IDC_COMBO_CONCOM, m_comboConCom);
	DDX_Control(pDX, IDC_COMBO_RECBAUD, m_comboRecBaud);
	DDX_Control(pDX, IDC_COMBO_RECCOM, m_comboRecCom);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSettingDlg, CDialog)
	//{{AFX_MSG_MAP(CSettingDlg)
	ON_BN_CLICKED(IDC_BUTTON_OK, OnButtonOk)
	ON_BN_CLICKED(IDC_BUTTON_CANCEL, OnButtonCancel)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSettingDlg message handlers

BOOL CSettingDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	//"1" "19200"
	CString strTemp;
	int nIndex = 0;

	strTemp = "COM"+m_strRecCom;
	nIndex = m_comboRecCom.FindString(nIndex, strTemp);
	m_comboRecCom.SetCurSel(nIndex);
	
	strTemp =  "COM"+m_strConCom;
	nIndex = m_comboConCom.FindString(nIndex, strTemp);
	m_comboConCom.SetCurSel(nIndex);

	nIndex = m_comboRecBaud.FindString(nIndex,m_strRecBaud);
	m_comboRecBaud.SetCurSel(nIndex);

	nIndex = m_comboConBaud.FindString(nIndex,m_strConBaud);
	m_comboConBaud.SetCurSel(nIndex);
	
	UpdateData(false);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSettingDlg::OnButtonOk() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	m_comboRecCom.GetLBText(m_comboRecCom.GetCurSel(),m_strRecCom);
	m_strRecCom = m_strRecCom.Right(1);
	
	m_comboConCom.GetLBText(m_comboConCom.GetCurSel(),m_strConCom);
	m_strConCom = m_strConCom.Right(1);
	
	m_comboRecBaud.GetLBText(m_comboRecBaud.GetCurSel(),m_strRecBaud);
	m_comboConBaud.GetLBText(m_comboConBaud.GetCurSel(),m_strConBaud);
	
	CDialog::OnOK();
}

void CSettingDlg::OnButtonCancel() 
{
	// TODO: Add your control notification handler code here
	CDialog::OnCancel();
}

void CSettingDlg::SetRecCom(CString strRecCom)
{
	m_strRecCom = strRecCom;
}

CString	 CSettingDlg::GetRecCom()
{
	return m_strRecCom;
}

void CSettingDlg::SetRecBaud(CString strRecBaud)
{
	m_strRecBaud = strRecBaud;
}

CString CSettingDlg::GetRecBaud()
{
	return m_strRecBaud;
}

void CSettingDlg::SetConCom(CString strConCom)
{
	m_strConCom = strConCom;
}

CString	 CSettingDlg::GetConCom()
{
	return m_strConCom;
}

void CSettingDlg::SetConBaud(CString strConBaud)
{
	m_strConBaud = strConBaud;
}

CString CSettingDlg::GetConBaud()
{
	return m_strConBaud;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -