ipchoice.cpp

来自「nucleus source 源码 全部源码」· C++ 代码 · 共 91 行

CPP
91
字号
// IPChoice.cpp : implementation file
//

#include "stdafx.h"
#include "WinDemo.h"
#include "IPChoice.h"

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

/////////////////////////////////////////////////////////////////////////////
// CIPChoice dialog

int ChoiceIP = 0;

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


void CIPChoice::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CIPChoice)
	DDX_Control(pDX, IDC_AutoIP, m_AutoIP);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CIPChoice, CDialog)
	//{{AFX_MSG_MAP(CIPChoice)
	ON_BN_CLICKED(IDC_AutoIP, OnAutoIP)
	ON_BN_CLICKED(IDC_GiveIP, OnGiveIP)
	ON_BN_CLICKED(IDC_Cancel, OnCancel)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CIPChoice message handlers

void CIPChoice::OnOK() 
{
	// TODO: Add extra validation here

    if (ChoiceIP != 2)
        ChoiceIP = 1;
	
	CDialog::OnOK();
}

void CIPChoice::OnAutoIP() 
{
	// TODO: Add your control notification handler code here
	ChoiceIP = 1;
}

void CIPChoice::OnGiveIP() 
{
	// TODO: Add your control notification handler code here
	ChoiceIP = 2;
}

int CIPChoice::DoModal() 
{
	// TODO: Add your specialized code here and/or call the base class
	
	return CDialog::DoModal();
}

void CIPChoice::OnCancel() 
{
	CDialog::OnCancel();
}

BOOL CIPChoice::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
    m_AutoIP.SetCheck(1);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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