www.pudn.com > only.rar > SETUP.cpp
// SETUP.cpp : implementation file
//
#include "stdafx.h"
#include "only.h"
#include "SETUP.h"
#include "tongyong.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// SETUP dialog
SETUP::SETUP(CWnd* pParent /*=NULL*/)
: CDialog(SETUP::IDD, pParent)
{
//{{AFX_DATA_INIT(SETUP)
m_buserfirst = -1;
m_bwithcomputer = -1;
//}}AFX_DATA_INIT
}
void SETUP::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SETUP)
DDX_Control(pDX, IDC_CHECK_SOUND, m_checksound);
DDX_Radio(pDX, IDC_RADIO_USERFIRST, m_buserfirst);
DDX_Radio(pDX, IDC_RADIO_WITHCOMPER, m_bwithcomputer);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SETUP, CDialog)
//{{AFX_MSG_MAP(SETUP)
ON_BN_CLICKED(IDC_RADIO_WITHCOMPER, OnRadioWithcomper)
ON_BN_CLICKED(IDC_RADIO_TWOUSERS, OnRadioTwousers)
ON_BN_CLICKED(IDC_RADIO_USERFIRST, OnRadioUserfirst)
ON_BN_CLICKED(IDC_RADIO_COMPUTERFIRST, OnRadioComputerfirst)
ON_BN_CLICKED(IDC_CHECK_SOUND, OnCheckSound)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// SETUP message handlers
void SETUP::OnRadioWithcomper()
{
// TODO: Add your control notification handler code here
g_RunMode=1;
UpdateData(TRUE);
if(m_bwithcomputer==0)
{
GetDlgItem(IDC_RADIO_USERFIRST)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO_COMPUTERFIRST)->EnableWindow(TRUE);
}
else
{
GetDlgItem(IDC_RADIO_USERFIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO_COMPUTERFIRST)->EnableWindow(FALSE);
}
}
void SETUP::OnRadioTwousers()
{
// TODO: Add your control notification handler code here
g_RunMode=0;
UpdateData(TRUE);
m_bwithcomputer=0;
if(m_bwithcomputer==1)
{
GetDlgItem(IDC_RADIO_USERFIRST)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO_COMPUTERFIRST)->EnableWindow(TRUE);
}
else
{
GetDlgItem(IDC_RADIO_USERFIRST)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO_COMPUTERFIRST)->EnableWindow(FALSE);
}
}
void SETUP::OnRadioUserfirst()
{
// TODO: Add your control notification handler code here
m_buserfirst=1;
g_UserFirst=true;
}
void SETUP::OnRadioComputerfirst()
{
// TODO: Add your control notification handler code here
m_buserfirst=0;
g_UserFirst=false;
}
void SETUP::OnCheckSound()
{
// TODO: Add your control notification handler code here
}
BOOL SETUP::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}