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

📄 source.h

📁 在视图里实现链表
💻 H
字号:
#if !defined(AFX_SOURCE_H__12013878_0935_4ACB_B1F6_F5B8170C7A31__INCLUDED_)
#define AFX_SOURCE_H__12013878_0935_4ACB_B1F6_F5B8170C7A31__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Source.h : header file
//

#define NODEWIDTH 400
#define NODEHEIGHT 100
#define SPOINTSIZE 10
/*
	cos(alf)  -sin(alf)
	sin(alf)  cos(alf)
*/

/////////////////////////////////////////////////////////////////////////////
// CNode command target

class CNode : public CCmdTarget
{
	DECLARE_DYNCREATE(CNode)
public:
	CNode();           // protected constructor used by dynamic creation
	friend class CDataList;
// Attributes
public:
private:
	int m_nLVal;
	int m_nRVal;
	CNode* m_pPrev;
	CNode* m_pNext;
	int m_nXPos;
	int m_nYPos;
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNode)
	//}}AFX_VIRTUAL

// Implementation
protected:
public:
	BOOL TestTouch(CDC* pDC,CPoint point);
	void SetCurrent(BOOL bCurrent);
	BOOL m_bCurrent;
	void Draw(CDC* pDC);
	void SetPos(int xPos,int yPos);
	void SetData(int lVal,int rVal);
	virtual ~CNode();

	// Generated message map functions
	//{{AFX_MSG(CNode)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////////////////////////////
// CDataList command target

class CDataList : public CCmdTarget
{
	DECLARE_DYNCREATE(CDataList)
public:
	CDataList();           // protected constructor used by dynamic creation

// Attributes
public:
private:
	CNode* m_pHead;
	CNode* m_pTail;
	CNode* m_pCurrent;
	int		m_nNodeCount;
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDataList)
	//}}AFX_VIRTUAL

// Implementation
protected:
public:
	void Offset(int xoff,int yOff);
	void DeleteNode();
	BOOL SetCurrent(CDC* pDC,CPoint point);
	void Draw(CDC* pDC);
	void Add(CNode* pNode);
	virtual ~CDataList();

	// Generated message map functions
	//{{AFX_MSG(CDataList)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CInputDlg dialog

class CInputDlg : public CDialog
{
// Construction
public:
	void SetParent(CEx702View* pParent);
	CEx702View* m_pParent;
	CInputDlg(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CInputDlg)
	enum { IDD = IDD_DIALOG1 };
	int		m_LVal;
	int		m_RVal;
	CString	m_strInfo;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CInputDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CInputDlg)
	afx_msg void OnUpdate();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SOURCE_H__12013878_0935_4ACB_B1F6_F5B8170C7A31__INCLUDED_)

⌨️ 快捷键说明

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