-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditableListCtrl.h
executable file
·129 lines (100 loc) · 3.03 KB
/
EditableListCtrl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#if !defined(AFX_EDITABLELISTCTRL_H__A3F56ED5_F876_4791_9D18_E31B4CCB8E35__INCLUDED_)
#define AFX_EDITABLELISTCTRL_H__A3F56ED5_F876_4791_9D18_E31B4CCB8E35__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditableListCtrl.h : header file
//
#define LVN_ENDDRAG (WM_USER + 1)
// Editor
class CELCEdit : public CEdit
{
// Construction
public:
CELCEdit();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CELCEdit)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CELCEdit();
// Generated message map functions
protected:
//{{AFX_MSG(CELCEdit)
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
public:
afx_msg void OnEditCopy();
afx_msg void OnEditCut();
afx_msg void OnEditPaste();
afx_msg void OnEditUndo();
afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
protected:
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
// CEditableListCtrl window
class CEditableListCtrl : public CListCtrl
{
// Construction
public:
CEditableListCtrl();
// Attributes
public:
// Operations
public:
void SetEditText (CString str);
void SetFixedCol (int nCol);
void SetFixedRows (bool bIsFixedRows);
void MoveEdit (int nUp, int nRight);
void SaveEdit();
void SetEditPos(int x, int y);
CPoint GetEditPos();
void BeginDrag(NMLISTVIEW* pNmlv);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEditableListCtrl)
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
void SetDefaultIcon (int nDefaultIcon);
virtual ~CEditableListCtrl();
// Generated message map functions
protected:
int m_nDefaultIcon;
bool m_bInit;
int m_nCurEditX, m_nCurEditY;
CELCEdit m_Edit;
CELCEdit& GetEdit();
int GetNextRow (int nRow, bool bForeward = true);
bool m_bIsFixedRows;
int GetNextEditableCol (int nCol, bool bForeward = true);
CMapWordToPtr m_mapFixedCol;
CImageList* m_pDragImageList;
bool m_bIsDragging;
int m_nDragItem;
//{{AFX_MSG(CEditableListCtrl)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EDITABLELISTCTRL_H__A3F56ED5_F876_4791_9D18_E31B4CCB8E35__INCLUDED_)