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

📄 caldlg.cpp

📁 a simple game vc++写的 24 点小游戏
💻 CPP
字号:
// CalDlg.cpp : implementation file
//

#include "stdafx.h"
#include "新二十四点.h"
#include "CalDlg.h"
#include "新二十四点View.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCalDlg dialog

CCalDlg::CCalDlg(CMyView *view,CWnd* pParent /*=NULL*/)
	: CDialog(CCalDlg::IDD, pParent)
{
	m_view=view;
}


void CCalDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCalDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCalDlg, CDialog)
	//{{AFX_MSG_MAP(CCalDlg)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCalDlg message handlers

void CCalDlg::OnButton1() 
{
	// TODO: Add your control notification handler code here
	int a,b,c,d;
	a=GetDlgItemInt(IDC_A);
	b=GetDlgItemInt(IDC_B);
	c=GetDlgItemInt(IDC_C);
	d=GetDlgItemInt(IDC_D);
	short mypoke[4]={a,b,c,d};
	
	m_view->Algorithum(mypoke);
	CListBox *listbox=(CListBox*)GetDlgItem(IDC_LISTRESULT);
	listbox->ResetContent();
	if(m_view->m_sArray.GetSize()==0)
	{
		listbox->AddString("没有答案");
	}
	else
	{
		for(int i=0;i<m_view->m_sArray.GetSize();i++)
		{
			listbox->AddString(m_view->m_sArray[i]);
		}
	}
}

⌨️ 快捷键说明

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