【文件属性】:
文件名称:黑白棋mfc简单版
文件大小:4.61MB
文件格式:ZIP
更新时间:2021-06-09 04:12:34
黑白棋 mfc
#include "stdafx.h"
#include "Draw.h"
#include
#include
#include "DrawDoc.h"
#include "DrawView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//zhan//
////////////////////////////////////////////////////////////////////////////
// CDrawView
IMPLEMENT_DYNCREATE(CDrawView, CView)
BEGIN_MESSAGE_MAP(CDrawView, CView)
//{{AFX_MSG_MAP(CDrawView)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDrawView construction/destruction
CDrawView::CDrawView()
{
// TODO: add construction code here
}
CDrawView::~CDrawView()
{
}
BOOL CDrawView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CDrawView drawing
int board[8][8];
CBrush white(RGB(255,255,255));
CBrush black(RGB(0,0,0));
int player = 1;
struct node{
int data[8][8];
struct node*next;
};
struct node *head;
void CDrawView::OnDraw(CDC* pDC)
{
int i,j;
CDrawDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
pDC->Rectangle(CRect(490,0,550,20));
pDC->DrawText("悔棋",CRect(500,5,600,20),0);
if(player==1)
{
pDC->DrawText("白棋",CRect(0,0,100,20),0);
}
else
{
pDC->DrawText("黑棋",CRect(0,0,100,20),0);
}
for(i=0;i<9;i++)
{
pDC->MoveTo(50,50+50*i);
【文件预览】:
Draw
----DrawView.cpp(7KB)
----Draw.plg(242B)
----Debug()
--------vc60.pdb(356KB)
--------DrawView.sbr(0B)
--------Draw.exe(120KB)
--------Draw.obj(22KB)
--------vc60.idb(297KB)
--------StdAfx.obj(103KB)
--------DrawDoc.sbr(0B)
--------MainFrm.sbr(0B)
--------MainFrm.obj(20KB)
--------Draw.res(7KB)
--------Draw.pdb(465KB)
--------StdAfx.sbr(1.31MB)
--------Draw.sbr(0B)
--------Draw.bsc(3.49MB)
--------DrawDoc.obj(14KB)
--------Draw.pch(6.68MB)
--------DrawView.obj(33KB)
--------Draw.ilk(382KB)
----Draw.opt(48KB)
----Draw.rc(10KB)
----Draw.aps(28KB)
----ReadMe.txt(4KB)
----DrawDoc.cpp(2KB)
----Draw.h(1KB)
----res()
--------Toolbar.bmp(1KB)
--------Draw.rc2(396B)
--------DrawDoc.ico(1KB)
--------Draw.ico(1KB)
----DrawView.h(2KB)
----DrawDoc.h(1KB)
----MainFrm.h(2KB)
----Resource.h(490B)
----Draw.dsp(4KB)
----StdAfx.cpp(206B)
----Draw.ncb(81KB)
----Draw.cpp(4KB)
----Draw.clw(2KB)
----MainFrm.cpp(2KB)
----StdAfx.h(1KB)