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