?? choicedlg.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 + -