📄 programview.h
字号:
// ProgramView.h : interface of the CProgramView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_PROGRAMVIEW_H__F48836F3_B3A9_43D2_8BF4_5330BEC70D9E__INCLUDED_)
#define AFX_PROGRAMVIEW_H__F48836F3_B3A9_43D2_8BF4_5330BEC70D9E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Card.h"
#include "NetControl.h"
#include "Name.h"
//定义按钮的ID
#define ID_OK 100
#define ID_CANCEL 101
#define ID_SENDCARD 102
#define ID_PASS 103
#define ID_TEST 104
class CProgramView : public CView
{
protected: // create from serialization only
CProgramView();
DECLARE_DYNCREATE(CProgramView)
// Attributes
public:
CProgramDoc* GetDocument();
NetControl *pControl;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProgramView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
//}}AFX_VIRTUAL
//定义画图用CDC
CDC Background;
CDC Mcard;
//定义画图用CBitmap
CBitmap m_background;
CBitmap m_card;
//定义BUTTON对象
CButton m_ok;
CButton m_cancel;
CButton m_sendcard;
CButton m_pass;
//测试
CButton m_test;
//定义指针
Card *cardleft;
Card *cardmiddle;
Card *cardright;
Card OutCards[3][20];
// Implementation
public:
bool isgoon;
void OnTimer(UINT nIDEvent);
void PrintAll(int type);
void PlayerPos();
void PrintState();
void DrawCardOut(int k);
void DrawLeft();//绘出剩下的地主的牌,当地主还没决定的时候画的是牌的背面,决定地主
//后画出地主的牌
void DrawPlayername();//根据传入的字符串,绘出玩家的名称
void OnPass();//点击过牌按钮后的响应函数
void OnSendCard();//画出当前玩家所出的牌
int SelectNum(int num,int mx,int my);//判断玩家点牌后具体点的是哪一张
void DrawOtherCard();//画出另外两个玩家还剩下的牌,以及
//他们刚刚出牌
void DrawMyCard();//画出当前玩家手中牌
void OnCancel();//点击退出按钮后的响应函数
void OnOK();//点击确定按钮后的响应函数
virtual ~CProgramView();
CString PlayerName[3];//用来存放三个玩家姓名的字符串
void PrintAll();//整体重画
friend class NetControl;
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CProgramView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int timer;
void CardReady();//用来画还没发牌时牌的情况
};
#ifndef _DEBUG // debug version in ProgramView.cpp
inline CProgramDoc* CProgramView::GetDocument()
{ return (CProgramDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PROGRAMVIEW_H__F48836F3_B3A9_43D2_8BF4_5330BEC70D9E__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -