📄 newmap.cpp
字号:
// newmap.cpp : implementation file
/*********************************
[学VC编游戏]
编著、程序设计:唐明理 2004.7
E-mail: cqtml@163.com
**********************************/
#include "stdafx.h"
#include "地图编辑器.h"
#include "newmap.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CString new_scr0;//选择地图大小
int new_js; //选择角色
CString new_map; //选择地面
int p;
/////////////////////////////////////////////////////////////////////////////
// newmap dialog
newmap::newmap(CWnd* pParent /*=NULL*/)
: CDialog(newmap::IDD, pParent)
{ //{{AFX_DATA_INIT(newmap)
//}}AFX_DATA_INIT
}
void newmap::DoDataExchange(CDataExchange* pDX)
{ CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(newmap)
DDX_Control(pDX, IDC_RADIO1, m_iRadio);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(newmap, CDialog)
//{{AFX_MSG_MAP(newmap)
ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// newmap message handlers
void newmap::OnRadio1() //选择男
{ new_js=0;}
void newmap::OnRadio2() //选择女
{ new_js=1;}
void newmap::OnOK() //确定
{ GetDlgItemText(IDC_COMBO1, new_scr0);//地图大小
CDialog::OnOK();
}
void newmap::OnCancel() //取消
{ new_scr0="";
CDialog::OnCancel();
}
BOOL newmap::OnInitDialog()
{ CDialog::OnInitDialog();
SetDlgItemText(IDC_COMBO1, "6 X 6");//地图大小默认值
m_iRadio.SetCheck(1); new_js=0; //主角默认值
p=0; new_map="地面a.BMP"; //地面默认值
GetDlgItem(IDC_STATIC1)->MoveWindow( 220,68,65,56,TRUE);
return TRUE;
}
BOOL newmap::PreTranslateMessage(MSG* pMsg)
{ CRect lpRect0;
CString cc;
GetWindowRect(&lpRect0);
int x=pMsg->pt.x-lpRect0.left;
int y=pMsg->pt.y-lpRect0.top;
if(x>15&&x<290&&y>170&&y<229&&
pMsg->message==WM_LBUTTONDOWN)//按左键
{CClientDC dc(this);
p=((x-15)/70)%4;
BitBlt(dc.m_hDC,222,70,62,53,dc.m_hDC,15+70*p,150,0xcc0020);
if(p==0) new_map="地面a.BMP";
if(p==1) new_map="地面b.BMP";
if(p==2) new_map="地面c.BMP";
if(p==3) new_map="地面d.BMP";
}
return CDialog::PreTranslateMessage(pMsg);
}
void newmap::OnPaint()
{ CClientDC dc(this);
BitBlt(dc.m_hDC,222,70,62,53,dc.m_hDC,15+70*p,150,0xcc0020);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -