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

📄 propertypage1.cpp

📁 网络游戏龙族服务器端管理工具 rmtool 源代码
💻 CPP
字号:
// PropertyPage1.cpp : implementation file
//

#include "stdafx.h"
//#include "Define
#include "rmtool.h"
#include "Propertys.h"
#include "PropertyPage_IP.h"
#include "PropertyPage1.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPropertyPage1 property page

IMPLEMENT_DYNCREATE(CPropertyPage1, CPropertyPage)

CPropertyPage1::CPropertyPage1() : CPropertyPage(CPropertyPage1::IDD)
{
	//{{AFX_DATA_INIT(CPropertyPage1)
	m_iMaxItemNum = 1000;
	m_iMaxItemType = 11;
	//}}AFX_DATA_INIT
}

CPropertyPage1::~CPropertyPage1()
{
}

void CPropertyPage1::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPropertyPage1)
	DDX_Control(pDX, IDC_IP_TOTAL, c_TotalDB_Address);
	DDX_Control(pDX, IDC_COM_SERVERNUMBER, c_ServerNumber);
	DDX_Control(pDX, IDC_COM_NATION, c_Nation);
	DDX_Text(pDX, IDC_MAX_ITEM_NUM, m_iMaxItemNum);
	DDV_MinMaxInt(pDX, m_iMaxItemNum, 1, 10000);
	DDX_Text(pDX, IDC_MAX_ITEM_TYPE, m_iMaxItemType);
	DDV_MinMaxInt(pDX, m_iMaxItemType, 1, 100);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPropertyPage1, CPropertyPage)
	//{{AFX_MSG_MAP(CPropertyPage1)
	ON_CBN_EDITCHANGE(IDC_COM_SERVERNUMBER, OnEditchangeComServernumber)
	ON_CBN_SETFOCUS(IDC_COM_SERVERNUMBER, OnSetfocusComServernumber)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPropertyPage1 message handlers

BOOL CPropertyPage1::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	// TODO: Add extra initialization here

	((CPropertys*)GetParent())->SetWizardButtons( 0 );
	//((CPropertys*)GetParent())->SetWizardButtons( PSWIZB_NEXT );

	char *pszNations[ MAX_NATION_NUM ]  = {"JAPAN","HONGKONG","CHAINA","TAIWAN","KOREA"};

	for(int i = 0; i < MAX_NATION_NUM ; i++)
	{
		c_Nation.InsertString( 0, pszNations[ i ] );
	}
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

LRESULT CPropertyPage1::OnWizardNext() 
{
	// TODO: Add your specialized code here and/or call the base class

	if( c_ServerNumber.GetCurSel() < 0 )	
		return 0;

	CString rString;
	c_ServerNumber.GetLBText(c_ServerNumber.GetCurSel(),rString);

	m_iServerNumber = atoi(rString);

	BYTE flag1, flag2, flag3, flag4;
	c_TotalDB_Address.GetAddress( flag1, flag2, flag3, flag4);
	m_szTotalDBAddress.Format("%d.%d.%d.%d", flag1, flag2, flag3, flag4);
	c_Nation.GetLBText(c_Nation.GetCurSel(),m_szNation);		//nation name setting

	
	if(!AddIPPage( m_iServerNumber )) //辑滚 荐父怒.. 货肺款 其捞瘤甫 父惦
	{
		AfxMessageBox("Overflow in current server numvers decision");
		return false;
	}
	return CPropertyPage::OnWizardNext();
}

bool CPropertyPage1::AddIPPage(int iServNumber)
{
	if(iServNumber > MAX_SERVERSET_NUM )
		return false;
	
	char szTmp[15];

	for (int i = 1; i <= iServNumber ; i++)
	{

		CPropertyPage_IP *m_pPage = new CPropertyPage_IP;//pPage(pszPageName);
		m_pPage->m_iPageNum = i;	//Set Page Number

		sprintf( szTmp, "%d's IP Address", i);
		m_pPage->m_szPagename = szTmp;

		if( i == iServNumber )	m_pPage->m_bLastDia = true;

		((CPropertys*)GetParent())->AddPage(m_pPage);
		
	}
	return true;
}
void CPropertyPage1::OnEditchangeComServernumber() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);

	((CPropertys*)GetParent())->SetWizardButtons( PSWIZB_NEXT );

}

void CPropertyPage1::OnSetfocusComServernumber() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);

	((CPropertys*)GetParent())->SetWizardButtons( PSWIZB_NEXT );
}

⌨️ 快捷键说明

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