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

📄 choicedlg.cpp

📁 VisualC高级编程技术精粹.rar
💻 CPP
字号:
// ChoiceDlg.cpp : implementation file
//

#include "stdafx.h"
#include "NonModeDlg.h"
#include "ChoiceDlg.h"
#include "NonModeDlgDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CChoiceDlg dialog


CChoiceDlg::CChoiceDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CChoiceDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CChoiceDlg)
		// NOTE: the ClassWizard will add member initialization here
	m_csSelCountry = _T("");
	//}}AFX_DATA_INIT

	ASSERT( pParent != NULL );
	m_pParent = pParent;
	m_nID = CChoiceDlg::IDD;
}


void CChoiceDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CChoiceDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	DDX_Text(pDX, IDC_EDIT_SEL_COUNTRY, m_csSelCountry);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CChoiceDlg, CDialog)
	//{{AFX_MSG_MAP(CChoiceDlg)
	ON_BN_CLICKED(IDC_RADIO_CHINA, OnRadioChina)
	ON_BN_CLICKED(IDC_RADIO_AMERICA, OnRadioAmerica)
	ON_BN_CLICKED(IDC_RADIO_AUSTRALIA, OnRadioAustralia)
	ON_BN_CLICKED(IDC_RADIO_FINLAND, OnRadioFinland)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChoiceDlg message handlers
BOOL CChoiceDlg::Create()
{
	return CDialog::Create( m_nID, m_pParent );
}

void CChoiceDlg::PostNcDestroy()
{
	delete this;
}

void CChoiceDlg::OnRadioChina() 
{
	m_csSelCountry = _T("中国");
	UpdateData(FALSE);
	
}

void CChoiceDlg::OnRadioAmerica() 
{
	m_csSelCountry = _T("美国");
	UpdateData(FALSE);
	
}

void CChoiceDlg::OnRadioAustralia() 
{
	m_csSelCountry = _T("澳大利亚");
	UpdateData(FALSE);
	
}

void CChoiceDlg::OnRadioFinland() 
{
	m_csSelCountry = _T("芬兰");
	UpdateData(FALSE);
	
}

void CChoiceDlg::OnOK() 
{
	CEdit *pEdit = (CEdit*)GetDlgItem( IDC_EDIT_KNOWLEDGE ); //子窗口
	CEdit *qEdit = (CEdit*)( m_pParent->GetDlgItem(IDC_EDIT_EDUCATIONAL_LEVEL) ); //父窗口
	ASSERT( pEdit != NULL );
	ASSERT( qEdit != NULL );

	if ( pEdit != NULL && qEdit != NULL )
	{
		CString csDstString = _T("");
		pEdit->GetWindowText( csDstString );
		qEdit->SetWindowText( csDstString );
	}	
}

void CChoiceDlg::OnCancel() 
{
	((CNonModeDlgDlg*)m_pParent)->Finish();
	DestroyWindow();	
}

⌨️ 快捷键说明

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