2
#include "ListCtrlSetter.h"
5
ListCtrlSetter::ListCtrlSetter( CListCtrl &list ) :
12
ListCtrlSetter::~ListCtrlSetter()
18
ListCtrlSetter::modifyLine( int nLineNo )
20
editLine( nLineNo, nLineNo >= m_List.GetItemCount() );
25
ListCtrlSetter::addLine()
27
editLine( m_List.GetItemCount(), true );
32
ListCtrlSetter::insertLine( int nLineNo )
34
editLine( nLineNo, true );
39
ListCtrlSetter::editLine( int nLineNo,
43
m_bInsertLine = bInsertLine;
49
ListCtrlSetter::addSubItem( const CString &strText )
51
doAddSubItem( LVIF_TEXT, strText, 0 );
56
ListCtrlSetter::addSubItem( const CString &strText,
59
doAddSubItem( LVIF_TEXT | LVIF_PARAM, strText, 0, lParam );
64
ListCtrlSetter::addSubItem( const CString &strText,
67
doAddSubItem( LVIF_TEXT | LVIF_IMAGE, strText, nImage );
72
ListCtrlSetter::addSubItem( const CString &strText,
76
doAddSubItem( LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM, strText, 0, lParam );
81
ListCtrlSetter::doAddSubItem( UINT nMask,
86
int textLength = strText.GetLength();
90
item.pszText = strText.GetBuffer( textLength );
91
item.cchTextMax = textLength;
93
item.lParam = (LPARAM)lParam;
94
item.iItem = m_nLineNo;
95
item.iSubItem = m_nNextSubItem++;
96
if ( m_nNextSubItem == 1 &&
97
m_bInsertLine ) // First item & new line
99
m_nLineNo = m_List.InsertItem( &item );
100
VERIFY( m_nLineNo >= 0 );
104
VERIFY( m_List.SetItem( &item ) );
107
strText.ReleaseBuffer();
112
ListCtrlSetter::getLineNo() const