📄 baselist.h
字号:
#if !defined(AFX_BASELIST_H__74D65B38_5927_45EB_BA9A_52C17672BF06__INCLUDED_)
#define AFX_BASELIST_H__74D65B38_5927_45EB_BA9A_52C17672BF06__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BaseList.h : header file
//
#include "list.h"
#include "ListCtrlPop.h"
#include <afxtempl.h>
#define SETNEXTITEMPHFOCUS WM_USER+12
#define MYMESSAGE_EDIT_MOVED WM_USER+11
#define MYMESSAGE_EDIT_ESC WM_USER+13
#define MYMESSAGE_EDIT_RETURN WM_USER+14
/////////////////////////////////////////////////////////////////////////////
// CBaseEdit window
class CBaseEdit : public CEdit
{
// Construction
public:
CBaseEdit();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CBaseEdit)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
//}}AFX_VIRTUAL
// Implementation
public:
CFont m_font;
BOOL m_breturn;
BOOL m_besc;
long m_dSetFocusValue;
long m_dKillFocusValue;
long kc_number;
BOOL m_bInputValid;
virtual ~CBaseEdit();
// Generated message map functions
protected:
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//{{AFX_MSG(CBaseEdit)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnChange();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
};
/////////////////////////////////////////////////////////////////////////////
// CBaseList window
class CBaseList : public CListCtrl
{
public:
CBaseEdit m_edit;
int m_nItem; //被编辑表项的行号
int m_nSubItem; //被编辑表项的列号
int m_iEditedIndex;
protected:
//编辑控件
int CountCanEdited;
bool m_bSetValue;
int m_iStopDestroy;
BOOL m_Next;
CList<int,int> m_iColumnEdited;
enum KILL{NORMALKILL=0,ESCKILL=1,RETURNKILL=2};
CString m_sSetFocus;
protected:
CRect m_rectWindow;
KILL m_Kill;
CListCtrlPop * m_poplist;
// Construction
public:
CBaseList();
virtual ~CBaseList();
void EndEdit( BOOL bValidate );
BOOL BeginEdit();
bool m_bWaitPopList;
// Attributes
public:
friend class CBaseEdit;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CBaseList)
protected:
virtual void PreSubclassWindow();
virtual BOOL PreTranslateMessage(MSG* pMsg) ;
//}}AFX_VIRTUAL
// Implementation
public:
virtual bool DeleteSelected();
bool Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID);
void SetValueUnChange(CString sql);
bool SetTheEditFocus(const int& item,const int& subitem);
bool IsTheSubItemCanEdited(const int& subitem);
bool SetSubItemUnEdited(const int& subitem);
int GetCountCanEdited();
int GetSubItemNumber();
bool SetSubItemCanEdited(const int& subitem);
virtual void PreOnEditChar(const int& item, const int& subitem,UINT& key);
// Generated message map functions
protected:
virtual void OnEditUDNPMessage(const int& item,const int& subitem,UINT key);
virtual void OnESC(const int& item, const int& subitem);
virtual bool OnEditReturn(const int& item,const int& subitem);
virtual void OnEditSetFocus(const int& item,const int& subitem);
virtual void OnEditKillFocus(const int& item,const int& subitem);
virtual void OnNewEditChange(const int& item,const int& sub_item);
//{{AFX_MSG(CBaseList)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnKillFocus(CWnd* pNewWnd);
//}}AFX_MSG
virtual afx_msg BOOL SetNextItemFocus();
virtual afx_msg void OnParentMoved();
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BASELIST_H__74D65B38_5927_45EB_BA9A_52C17672BF06__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -