5 #include "RefLogList.h"
7 IMPLEMENT_DYNAMIC(CRefLogList
, CGitLogList
)
9 CRefLogList::CRefLogList()
11 m_ColumnRegKey
=_T("reflog");
15 void CRefLogList::InsertRefLogColumn()
19 int c
= ((CHeaderCtrl
*)(GetDlgItem(0)))->GetItemCount()-1;
25 InsertColumn(REFLOG_HASH
, temp
);
28 InsertColumn(REFLOG_REF
, temp
);
31 InsertColumn(REFLOG_ACTION
, temp
);
34 InsertColumn(REFLOG_MESSAGE
, temp
);
38 ResizeAllListCtrlCols();
42 void CRefLogList::OnLvnGetdispinfoLoglist(NMHDR
*pNMHDR
, LRESULT
*pResult
)
44 NMLVDISPINFO
*pDispInfo
= reinterpret_cast<NMLVDISPINFO
*>(pNMHDR
);
46 // Create a pointer to the item
47 LV_ITEM
* pItem
= &(pDispInfo
)->item
;
49 // Do the list need text information?
50 if (!(pItem
->mask
& LVIF_TEXT
))
53 // By default, clear text buffer.
54 lstrcpyn(pItem
->pszText
, _T(""), pItem
->cchTextMax
);
56 bool bOutOfRange
= pItem
->iItem
>= ShownCountWithStopped();
59 if (m_bNoDispUpdates
|| bOutOfRange
)
63 int itemid
= pItem
->iItem
;
64 GitRev
* pLogEntry
= NULL
;
65 if (itemid
< m_arShownList
.GetCount())
66 pLogEntry
= reinterpret_cast<GitRev
*>(m_arShownList
.GetAt(pItem
->iItem
));
71 switch (pItem
->iSubItem
)
73 case this->REFLOG_HASH
: //Graphic
76 lstrcpyn(pItem
->pszText
,pLogEntry
->m_CommitHash
, pItem
->cchTextMax
);
79 case REFLOG_REF
: //action -- no text in the column
81 lstrcpyn(pItem
->pszText
, pLogEntry
->m_Ref
, pItem
->cchTextMax
);
83 case REFLOG_ACTION
: //Message
85 lstrcpyn(pItem
->pszText
, (LPCTSTR
)pLogEntry
->m_RefAction
, pItem
->cchTextMax
);
87 case REFLOG_MESSAGE
: //Author
89 lstrcpyn(pItem
->pszText
, (LPCTSTR
)pLogEntry
->m_Subject
, pItem
->cchTextMax
);
97 void CRefLogList::OnNMCustomdrawLoglist(NMHDR
*pNMHDR
, LRESULT
*pResult
)
100 NMLVCUSTOMDRAW
* pLVCD
= reinterpret_cast<NMLVCUSTOMDRAW
*>( pNMHDR
);
101 // Take the default processing unless we set this to something else below.
102 *pResult
= CDRF_DODEFAULT
;