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

📄 phonedlg.h

📁 通讯录
💻 H
字号:
// phoneDlg.h : header file
//

#if !defined(AFX_DLG_H__689E1241_CC86_49C9_AE09_795F722B49E8__INCLUDED_)
#define AFX_DLG_H__689E1241_CC86_49C9_AE09_795F722B49E8__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CMyDlg dialog


class CFriend : public CObject
{
public:
	DECLARE_DYNCREATE(CFriend) //允许动态创建CStudent对象
    
	//int NO;  //每个人唯一的号码,用于区分
    CString name;
	int age;
    CString sex;
	CString email;
	CString note;
	CString phone;
	
	CFriend();
	CFriend(CString name,CString sex,int age,CString email,CString phone,CString note);
};

class CMyDlg : public CDialog
{
// Construction
public:
	CMyDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CMyDlg)
	enum { IDD = IDD_MY_DIALOG };
	CListCtrl	m_clc;
	CString	m_name;
	CString	m_note;
	CString	m_sex;
	CString	m_mail;
	int		m_age;
	CString	m_phone;
	CString	m_QueryText;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMyDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon(); 
	afx_msg void OnCancelMode();  
	afx_msg void OnClickList(NMHDR* pNMHDR, LRESULT* pResult);//点击图标
	afx_msg void OnFirst();    //点击"第一个"按钮
	afx_msg void OnLast();     //点击"最后一个"按钮
	afx_msg void OnExit();     //点击"退出"按钮
	afx_msg void OnNext();	   //点击"下一个"按钮
	afx_msg void OnPre();      //点击"上一个"按钮
	afx_msg void OnAdd();      //点击"添加"按钮
	afx_msg void OnDel();      //点击"删除"按钮
	afx_msg void OnMan();      //添加时,点击代表男性的图片
	afx_msg void OnWoman();    //添加时,点击代表女性的图片
	afx_msg void OnClose();    //处理WM_Close消息
	afx_msg void OnQuery();    //点击"查询>>"按钮
	afx_msg void OnQquery();   //查询里,点击查询按钮
	afx_msg void OnQname();    //查询里,点击姓名的RadioButton
	afx_msg void OnQage();     //查询里,点击年龄的RadioButton
	afx_msg void OnQmail();    //查询里,点击邮箱的RadioButton
	afx_msg void OnQphone();   //查询里,点击电话的RadioButton
	afx_msg void OnQnote();    //查询里,点击备注的RadioButton
	afx_msg void OnQsex();     //查询里,点击性别的RadioButton
	afx_msg void OnShowall();  //查询里,点击"显示全部"的按钮
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	CString time;
	bool IsNumber(CString text);  //text是否为数字串
	bool QueryState;             //变量,是否为查询状态
	void ListRefreshForFind();  //当处在查询态时,刷新列表信息,和listRefresh()的不同主要在于这里不调用ReadFiles();
	void FindFiles(CString FindItem,CString Text); //在文件中查找项目为FindItem,内容为(或包含)Text的项,记录在m_frdList中
	CString QueryItem;   //记录所要查询的项目
	CRect tempRect;     //记录当“查询”按钮为收缩态时的窗口位置及大小信息
	void GetPos();      //获取当前所选记录的位置,记录在curPos中
	void WriteFiles();  //写m_frdList到friends.txt
	void ListRefresh(); //刷新列表信息
	bool EditState;   //变量,是否为编辑状态
	void Hello();     //计算好友人数,显示在CListCtrl的左上方
	void ReadFile();  //从friends.txt读取信息到m_frdList
	CString phone;    //电话,中间变量,可以看做一个temp
	CString note;     //备注,中间变量,可以看做一个temp
	CString email;    //邮箱,中间变量,可以看做一个temp
	CString sex;      //性别,中间变量,可以看做一个temp
	int age;          //年龄,中间变量,可以看做一个temp
	CString name;     //姓名,中间变量,可以看做一个temp
	POSITION curPos;  //记录当前所选的项
    CTypedPtrList<CObList, CFriend*>   m_frdList; //创建链表,存储friends信息

};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DLG_H__689E1241_CC86_49C9_AE09_795F722B49E8__INCLUDED_)

⌨️ 快捷键说明

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