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

📄 lgamedlg.h

📁 小游戏锦集:猜数字
💻 H
字号:
// lgameDlg.h : header file
//

#if !defined(AFX_LGAMEDLG_H__048C208D_B458_4AE6_8C65_A053C156265B__INCLUDED_)
#define AFX_LGAMEDLG_H__048C208D_B458_4AE6_8C65_A053C156265B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CLgameDlg dialog

class CLgameDlg : public CDialog
{
// Construction
public:
	int guessnum,temp[4];
	CButton *btn[10];//,*b2,*b3,*b4,*b5,*b6,*b7,*b8;
	int Bpos[10];
	int intAg;//=0 default

	void changButton(int direc);
	void redraw();
	int checkWin();
	CLgameDlg(CWnd* pParent = NULL);	// standard constructor
//game 3:
	CBitmapButton micbtn[4];
	int timerv[5];//for 4 timer,return 1:show 0:hide
	int ideven[5];
	int micpos[10];//9 button in the KeyB ,return:1 have mic ,0 no
	int idpos[5];//4 timer,return pos in KeyB
	int hitnum;
	int micnum;
	void keymic(int key);
	int enable[5];//if this button is enable 1:enable ,0:disable
// Dialog Data
	//{{AFX_DATA(CLgameDlg)
	enum { IDD = IDD_LGAME_DIALOG };
	CEdit	m_e3;
	CButton	m_B3start;
	CEdit	m_e33;
	CEdit	m_e32;
	CEdit	m_e31;
	CStatic	m_S33;
	CStatic	m_S32;
	CStatic	m_S31;
	CComboBox	m_3lev;
	CEdit	m_E2time;
	CButton	m_B2ag;
	CStatic	m_S12;
	CStatic	m_S11;
	CButton	m_staticbor;
	CComboBox	m_comlev;
	CEdit	m_E1in;
	CEdit	m_E1ab;
	CButton	m_B1re;
	CButton	m_B1gu;
	CButton	m_B1ag;
	CTabCtrl	m_tab;
	CListBox	m_list1;
	CString	m_ed1ab;
	CString	m_ed1input;
	int		m_E2times;
	int		m_E3hit;
	int		m_E3mic;
	CString	m_E3ratio;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CLgameDlg)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CLgameDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBUTTON1ag();
	afx_msg void OnBUTTON1guess();
	afx_msg void OnBUTTON1real();
	afx_msg void OnButton2();
	afx_msg void OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnBUTTON2ag();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnBUTTON3start();
	afx_msg void OnButton1();
	afx_msg void OnButton331();
	afx_msg void OnButton332();
	afx_msg void OnButton333();
	afx_msg void OnButton334();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_LGAMEDLG_H__048C208D_B458_4AE6_8C65_A053C156265B__INCLUDED_)

/*
void CLgameDlg::changButton(int direct)
{
//CButton *btn[10];
//	int Bpos[10];
	int ag9pos=0,i=0,ag9i=0;
	if(direct==1)//up
		{
			if(Bpos[9]>6)return;
			ag9pos=Bpos[9]+3;
			for(i=1;i<9;i++)
				if(Bpos[i]==ag9pos)
					break;
			ag9i=i;			
			Bpos[ag9i]=Bpos[9];
			Bpos[9]=ag9pos;
			redraw(9,ag9i,Bpos[9],Bpos[ag9i]);
		}
	if(direct==2)//down
		{
			if(Bpos[9]<4)return;
			ag9pos=Bpos[9]-3;
			for(i=1;i<9;i++)
				if(Bpos[i]==ag9pos)
					break;
			ag9i=i;			
			Bpos[ag9i]=Bpos[9];
			Bpos[9]=ag9pos;
			redraw(9,ag9i,Bpos[9],Bpos[ag9i]);
		}
	if(direct==3)//left
		{
			if(Bpos[9]%3==0)return;
			ag9pos=Bpos[9]+1;
			for(i=1;i<9;i++)
				if(Bpos[i]==ag9pos)
					break;
			ag9i=i;			
			Bpos[ag9i]=Bpos[9];
			Bpos[9]=ag9pos;
			redraw(9,ag9i,Bpos[9],Bpos[ag9i]);
		}
	if(direct==4)//right
		{
			if(Bpos[9]%3==1)return;
			ag9pos=Bpos[9]-1;
			for(i=1;i<9;i++)
				if(Bpos[i]==ag9pos)
					break;
			ag9i=i;			
			Bpos[ag9i]=Bpos[9];
			Bpos[9]=ag9pos;
			redraw(9,ag9i,Bpos[9],Bpos[ag9i]);
		}
}
void CLgameDlg::redraw(int i1,int i2,int p1,int p2)
{
	if(intAg==0)
	{
		m_E2times++;
		UpdateData(0);
	}
	delete btn[i1];
	delete btn[i2];
	btn[i1]=new CButton;
	btn[i2]=new CButton;

	int x=20+((p1-1)%3)*20 , y=300+((p1-1)/3)*20;
	char dispn[5],num[2];memset(num,0,10);
	dispn[0]=dispn[2]='=';dispn[3]='\0';

		itoa(i1,num,10);
		dispn[1]=num[0];
		btn[i1]->Create(dispn,BS_DEFPUSHBUTTON,
			CRect(x,y,x+20,y+20),this,i1+100);
		if(i1!=9)
		btn[i1]->ShowWindow(SW_SHOW);

	x=20+((p2-1)%3)*20 ; y=300+((p2-1)/3)*20;
		itoa(i2,num,10);
		dispn[1]=num[0];
		btn[i2]->Create(dispn,BS_DEFPUSHBUTTON,
			CRect(x,y,x+20,y+20),this,i2+100);
		if(i2!=9)
		btn[i2]->ShowWindow(SW_SHOW);

		if(checkWin()==1)
		{
			 MessageBox("You Win.");
			 m_E2times=0;
			 UpdateData(0);
			 OnBUTTON2ag() ;
		}
}

int CLgameDlg::checkWin()
{
	int i=0,win=1;
	for(i=1;i<10;i++)
	{
		if(Bpos[i]==i)
			continue;
		win=0;
	}
	return win;
}
*/

⌨️ 快捷键说明

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