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

📄 basetabctrl1.h

📁 这是一个信息管理系统的源代码
💻 H
字号:
#include "myfunction.h"
#include <afxcoll.h>
#if !defined(AFX_BASETABCTRL1_H__025AC0EE_A22A_472F_A6ED_34973D14FC1C__INCLUDED_)
#define AFX_BASETABCTRL1_H__025AC0EE_A22A_472F_A6ED_34973D14FC1C__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CBaseTabCtrl window
#define MYMESSAGE_BAOCUNCLICK	WM_USER +20
#define MYMESSAGE_ZENGJIACLICK	WM_USER +21
#define MYMESSAGE_SHANCHUCLICK	WM_USER +22
#define MYMESSAGE_XIUGAICLICK	WM_USER +23
#define MYMESSAGE_CHAXUN		WM_USER +24
#define MYMESSAGE_EDITRETURN	WM_USER +25
#define MYMESSAGE_FIELDRETURN	WM_USER +26
#define MYMESSAGE_FUHAORETURN	WM_USER +27
#define MYMESSAGE_RQRETURN		WM_USER +28
#define MYMESSAGE_CHECKCHANGE	WM_USER +29

class CBaseTabCtrl : public CTabCtrl
{
// Construction
public:
	CBaseTabCtrl(int nfield);

// Attributes
public:
	enum{ID_STATICS_1=121};						//静态文本
	enum{ID_EDITS_1=161};						//编辑框用来显示值
	enum{ID_TABLIST=200};						//列表框,显示纪录
	enum{ID_BUTTONS_1=201};						//保存,删除,添加,取消,修改按钮
	enum{ID_CHECK=211};							//是否在查询结果中查询
	enum{ID_BUTTONCHAXUN=212};					//查询按钮
	enum{ID_EDITVALUE=213};						//用户输入的查询条件
	enum{ID_COMBOFIELDS=214};					//显示查询字段
	enum{ID_COMBOFUHAO=215};					//显示查询符号	
	enum{ID_TIMECONTROL=216};					//用来查询时间
	enum{RQQUERY=0,STRINGQUERY=1};				//区别时间查询,编辑框查询
	enum{NORMAL=0,ZENGJIA=1,XIUGAI=2,SHANCHU=3};//当前的状态
	

public:
	//base info	
	const int		mc_iNumber;		//记录编辑框和静态文本的个数			
	CStatic*		m_statics;					//静态文本
	CEdit*			m_edits;		//编辑框用来显示值
	CButton*		m_btn;			//保存,删除,添加,取消,修改按钮

	//list info
	CListCtrl*		m_list;						//列表框,显示纪录
	CButton			m_btnchaxun;				//查询按钮
	CComboBox		m_combofields;				//显示查询字段
	CComboBox		m_combofuhao;				//显示查询符号	
	CEdit			m_editvalue;				//用户输入的查询条件
	CDateTimeCtrl	m_tcvalue;					//用来查询时间
	CButton			m_check;					//是否在查询结果中查询
	CString			m_sFuhao[6];				//保存各种查询符号
	//list state;
	int				state;						//RQQUERY=0,STRINGQUERY=1
	CString			key_field;					//?
	CString			key_value;					//?
	int				key_index;					//?
	//baseinfo state;
	int				baseinfo_state;				//NORMAL=0,ZENGJIA=1,XIUGAI=2,SHANCHU=3
	//sql query

	CString			m_sTable;					//用来查询的视图
	CString			m_sTempTables[2];			//查询用的临时表
	int				m_iCurTable;				//标识当前的临时表


// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBaseTabCtrl)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
public:
	void SetListFocus(MSG* pMsg);
	virtual void SetTheBaseInfoFocus();//控制编辑框的焦点移动顺序
	bool InitBtn();
	bool SetStaticNumber(int n);
	void SetEditNumber(int n);
	BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );
	virtual ~CBaseTabCtrl();

	// Generated message map functions
protected:
	virtual int ShowListChaXun(int show);
	virtual void SetTheFocus();					//控制按钮的焦点移动顺序
	virtual bool EnableBaseInfo(bool enabled);
	virtual int ShowBaseInfo(int show);
	virtual void OnListReturn();
	virtual bool PrepareTables(CString& output,CString& input);
	virtual CString PrepareSQL();
	virtual bool InitValues();
	virtual bool RefreshListView(CString sql);
	virtual void OnComboFieldReturn();
	virtual void SetKey(int mark);
	virtual void OnRqValueReturn();
	virtual void OnEditValueReturn();
	virtual void OnComboFuhaoReturn();
	virtual bool InitList();
	virtual bool InitBaseInfo();
	virtual bool InitSelf();
	//{{AFX_MSG(CBaseTabCtrl)
	afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult) ;
	afx_msg void OnChaXun();
	afx_msg void OnCheckClick();
	afx_msg void OnCancelClick();
	afx_msg void OnXiuGaiClick();
	afx_msg void OnShanChuClick();
	afx_msg void OnZengJiaClick();
	afx_msg void OnBaoCunClick();
	afx_msg void OnSelendokComboFields();
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

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

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

#endif // !defined(AFX_BASETABCTRL1_H__025AC0EE_A22A_472F_A6ED_34973D14FC1C__INCLUDED_)

⌨️ 快捷键说明

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