blob: 1965a797ece560504a4458065de4d3ea409fc9fe (
plain)
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
|
#ifndef LISTCTRLSETTER_H
#define LISTCTRLSETTER_H
#include <string>
/*! \brief Helper to set up the content of a list control.
*/
class ListCtrlSetter
{
public:
/*!
* Constructor.
* \param list List control to fill.
*/
ListCtrlSetter( CListCtrl &list );
/*!
* Destructor.
*/
virtual ~ListCtrlSetter();
/*! Modifies the specified line.
* \param nLineNo number of the line to modify.
*/
void modifyLine( int nLineNo );
/*! Adds a new line at the end of the list.
*/
void addLine();
/*! Insert a new line in the list.
* \param nLineNo Line number before the new line is insert.
*/
void insertLine( int nLineNo );
void addSubItem( const CString &strText );
void addSubItem( const CString &strText, void *lParam );
void addSubItem( const CString &strText, int nImage );
void addSubItem( const CString &strText, void *lParam, int nImage );
/*! Gets the number of the line being modified.
* \return Number of the line being modified.
*/
int getLineNo() const;
private:
/*! Edit a line.
* \param nLineNo Number of the line to edit.
* \param bInsertLine \c true if the line is inserted, \c false if it is modified.
*/
void editLine( int nLineNo,
bool bInsertLine );
/*! Add a sub-item.
* \param nMask Mask LV_IF... to set.
* \param strText Sub-item Text.
* \param nImage Image number.
* \param lParam Item data pointer.
*/
void doAddSubItem( UINT nMask,
CString strText,
int nImage,
void *lParam =NULL );
private:
/*! List control which content is being set up.
*/
CListCtrl &m_List;
/*! Current line number (line being edited).
*/
int m_nLineNo;
/*! Line should be inserted ?
*/
bool m_bInsertLine;
/*! Next sub-item number.
*/
int m_nNextSubItem;
};
#endif //LISTCTRLSETTER_H
|