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

📄 seldialog.cpp

📁 下棋
💻 CPP
字号:
// SelDialog.cpp : implementation file
//

#include "stdafx.h"
#include "chess.h"
#include "SelDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSelDialog dialog


CSelDialog::CSelDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CSelDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSelDialog)
	m_addIP = _T("");
	//}}AFX_DATA_INIT
	m_bServer=TRUE;
}


void CSelDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSelDialog)
	DDX_Control(pDX, IDC_SHOW, m_staOne);
	DDX_Text(pDX, IDC_EDIT_ADDR, m_addIP);
	DDV_MaxChars(pDX, m_addIP, 16);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSelDialog, CDialog)
	//{{AFX_MSG_MAP(CSelDialog)
	ON_BN_CLICKED(IDC_RADIO_CLIENT, OnRadioClient)
	ON_BN_CLICKED(IDC_RADIO_SERVER, OnRadioServer)
	ON_WM_TIMER()
	ON_WM_CANCELMODE()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSelDialog message handlers

BOOL CSelDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CButton* pBut=(CButton*)GetDlgItem(IDC_RADIO_SERVER);
	pBut->SetCheck(1);
	GetDlgItem(IDC_TIP)->ShowWindow(FALSE);
	GetDlgItem(IDC_EDIT_ADDR)->ShowWindow(FALSE);
	SetTimer(1,400,NULL);
//	m_addIP.Replace(NULL,"YZC");
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

BOOL CSelDialog::IsServer()
{
return m_bServer;
}

void CSelDialog::OnRadioClient() 
{
	// TODO: Add your control notification handler code here
	GetDlgItem(IDC_TIP)->ShowWindow(TRUE);
	GetDlgItem(IDC_EDIT_ADDR)->ShowWindow(TRUE);
	m_bServer=FALSE;
	GetDlgItem(IDC_EDIT_ADDR)->SetWindowText("yzc");
	
}

void CSelDialog::OnRadioServer() 
{
	// TODO: Add your control notification handler code here
	GetDlgItem(IDC_TIP)->ShowWindow(FALSE);
	GetDlgItem(IDC_EDIT_ADDR)->ShowWindow(FALSE);
	m_bServer=TRUE;
	
}

void CSelDialog::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
    static BOOL bOne=TRUE;
	bOne=!bOne;
	//m_staOne.ShowWindow((bOne)?SW_SHOW:SW_HIDE);
	//m_staTwo.ShowWindow((bOne)?SW_HIDE:SW_SHOW);
	HICON hIcon=AfxGetApp()->LoadIcon((bOne)?
									  IDI_ONE:IDI_TWO);
	m_staOne.SetIcon(hIcon);
	UpdateWindow();
	CDialog::OnTimer(nIDEvent);
}

void CSelDialog::OnCancelMode() 
{
	CDialog::OnCancelMode();
	
	// TODO: Add your message handler code here
	
}

//DEL void CSelDialog::OnCancel() 
//DEL {
//DEL 	// TODO: Add extra cleanup here
//DEL 	
//DEL 	CDialog::OnCancel();
//DEL }

//DEL void CSelDialog::OnGameNew() 
//DEL {
//DEL 	// TODO: Add your command handler code here
//DEL 	
//DEL }

//DEL void CSelDialog::PostNcDestroy() 
//DEL {
//DEL 	// TODO: Add your specialized code here and/or call the base class
//DEL     KillTimer(1);	
//DEL 	CDialog::PostNcDestroy();
//DEL }

void CSelDialog::OnDestroy() 
{
	CDialog::OnDestroy();
	
     KillTimer(1);
		
}

//DEL void CSelDialog::OnOK() 
//DEL {
//DEL 	// TODO: Add extra validation here
//DEL 	
//DEL 	CDialog::OnOK();
//DEL }

⌨️ 快捷键说明

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