-#if 0\r
-void CLogDlg::OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult)\r
-{\r
-\r
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );\r
- // Take the default processing unless we set this to something else below.\r
- *pResult = CDRF_DODEFAULT;\r
-\r
- if (m_bNoDispUpdates)\r
- return;\r
-\r
- switch (pLVCD->nmcd.dwDrawStage)\r
- {\r
- case CDDS_PREPAINT:\r
- {\r
- *pResult = CDRF_NOTIFYITEMDRAW;\r
- return;\r
- }\r
- break;\r
- case CDDS_ITEMPREPAINT:\r
- {\r
- // This is the prepaint stage for an item. Here's where we set the\r
- // item's text color. \r
- \r
- // Tell Windows to send draw notifications for each subitem.\r
- *pResult = CDRF_NOTIFYSUBITEMDRAW;\r
-\r
- COLORREF crText = GetSysColor(COLOR_WINDOWTEXT);\r
-\r
- if (m_arShownList.GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec)\r
- {\r
- GitRev* data = (GitRev*)m_arShownList.GetAt(pLVCD->nmcd.dwItemSpec);\r
- if (data)\r
- {\r
-#if 0\r
- if (data->bCopiedSelf)\r
- {\r
- // only change the background color if the item is not 'hot' (on vista with themes enabled)\r
- if (!theme.IsAppThemed() || !m_bVista || ((pLVCD->nmcd.uItemState & CDIS_HOT)==0))\r
- pLVCD->clrTextBk = GetSysColor(COLOR_MENU);\r
- }\r
-\r
- if (data->bCopies)\r
- crText = m_Colors.GetColor(CColors::Modified);\r
-#endif\r
-// if ((data->childStackDepth)||(m_mergedRevs.find(data->Rev) != m_mergedRevs.end()))\r
-// crText = GetSysColor(COLOR_GRAYTEXT);\r
-// if (data->Rev == m_wcRev)\r
-// {\r
-// SelectObject(pLVCD->nmcd.hdc, m_boldFont);\r
- // We changed the font, so we're returning CDRF_NEWFONT. This\r
- // tells the control to recalculate the extent of the text.\r
-// *pResult = CDRF_NOTIFYSUBITEMDRAW | CDRF_NEWFONT;\r
-// }\r
- }\r
- }\r
- if (m_arShownList.GetCount() == (INT_PTR)pLVCD->nmcd.dwItemSpec)\r
- {\r
- if (m_bStrictStopped)\r
- crText = GetSysColor(COLOR_GRAYTEXT);\r
- }\r
- // Store the color back in the NMLVCUSTOMDRAW struct.\r
- pLVCD->clrText = crText;\r
- return;\r
- }\r
- break;\r
- case CDDS_ITEMPREPAINT|CDDS_ITEM|CDDS_SUBITEM:\r
- {\r
- if ((m_bStrictStopped)&&(m_arShownList.GetCount() == (INT_PTR)pLVCD->nmcd.dwItemSpec))\r
- {\r
- pLVCD->nmcd.uItemState &= ~(CDIS_SELECTED|CDIS_FOCUS);\r
- }\r
- if (pLVCD->iSubItem == 1)\r
- {\r
- *pResult = CDRF_DODEFAULT;\r
-\r
- if (m_arShownList.GetCount() <= (INT_PTR)pLVCD->nmcd.dwItemSpec)\r
- return;\r
-\r
- int nIcons = 0;\r
- int iconwidth = ::GetSystemMetrics(SM_CXSMICON);\r
- int iconheight = ::GetSystemMetrics(SM_CYSMICON);\r
-\r
- GitRev* pLogEntry = reinterpret_cast<GitRev *>(m_arShownList.GetAt(pLVCD->nmcd.dwItemSpec));\r
-\r
- // Get the selected state of the\r
- // item being drawn.\r
- LVITEM rItem;\r
- SecureZeroMemory(&rItem, sizeof(LVITEM));\r
- rItem.mask = LVIF_STATE;\r
- rItem.iItem = pLVCD->nmcd.dwItemSpec;\r
- rItem.stateMask = LVIS_SELECTED | LVIS_FOCUSED;\r
- m_LogList.GetItem(&rItem);\r
-\r
- CRect rect;\r
- m_LogList.GetSubItemRect(pLVCD->nmcd.dwItemSpec, pLVCD->iSubItem, LVIR_BOUNDS, rect);\r
-\r
- // Fill the background\r
- if (theme.IsAppThemed() && m_bVista)\r
- {\r
- theme.Open(m_hWnd, L"Explorer");\r
- int state = LISS_NORMAL;\r
- if (rItem.state & LVIS_SELECTED)\r
- {\r
- if (::GetFocus() == m_LogList.m_hWnd)\r
- state |= LISS_SELECTED;\r
- else\r
- state |= LISS_SELECTEDNOTFOCUS;\r
- }\r
- else\r
- {\r
-#if 0\r
- if (pLogEntry->bCopiedSelf)\r
- {\r
- // unfortunately, the pLVCD->nmcd.uItemState does not contain valid\r
- // information at this drawing stage. But we can check the whether the\r
- // previous stage changed the background color of the item\r
- if (pLVCD->clrTextBk == GetSysColor(COLOR_MENU))\r
- {\r
- HBRUSH brush;\r
- brush = ::CreateSolidBrush(::GetSysColor(COLOR_MENU));\r
- if (brush)\r
- {\r
- ::FillRect(pLVCD->nmcd.hdc, &rect, brush);\r
- ::DeleteObject(brush);\r
- }\r
- }\r
- }\r
-#endif\r
- }\r
-\r
- if (theme.IsBackgroundPartiallyTransparent(LVP_LISTDETAIL, state))\r
- theme.DrawParentBackground(m_hWnd, pLVCD->nmcd.hdc, &rect);\r
-\r
- theme.DrawBackground(pLVCD->nmcd.hdc, LVP_LISTDETAIL, state, &rect, NULL);\r
- }\r
- else\r
- {\r
- HBRUSH brush;\r
- if (rItem.state & LVIS_SELECTED)\r
- {\r
- if (::GetFocus() == m_LogList.m_hWnd)\r
- brush = ::CreateSolidBrush(::GetSysColor(COLOR_HIGHLIGHT));\r
- else\r
- brush = ::CreateSolidBrush(::GetSysColor(COLOR_BTNFACE));\r
- }\r
- else\r
- {\r
- //if (pLogEntry->bCopiedSelf)\r
- // brush = ::CreateSolidBrush(::GetSysColor(COLOR_MENU));\r
- //else\r
- brush = ::CreateSolidBrush(::GetSysColor(COLOR_WINDOW));\r
- }\r
- if (brush == NULL)\r
- return;\r
-\r
- ::FillRect(pLVCD->nmcd.hdc, &rect, brush);\r
- ::DeleteObject(brush);\r
- }\r
-\r
- // Draw the icon(s) into the compatible DC\r
- if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_MODIFIED)\r
- ::DrawIconEx(pLVCD->nmcd.hdc, rect.left + ICONITEMBORDER, rect.top, m_hModifiedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
- nIcons++;\r
-\r
- if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_ADDED)\r
- ::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hAddedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
- nIcons++;\r
-\r
- if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_DELETED)\r
- ::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hDeletedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
- nIcons++;\r
-\r
- if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_REPLACED)\r
- ::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hReplacedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
- nIcons++;\r
- *pResult = CDRF_SKIPDEFAULT;\r
- return;\r
- }\r
- }\r
- break;\r
- }\r
- *pResult = CDRF_DODEFAULT;\r
-\r
-}\r
-#endif\r
-\r
-void CLogDlg::OnNMCustomdrawChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)\r
-{\r
-\r
- NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );\r
- // Take the default processing unless we set this to something else below.\r
- *pResult = CDRF_DODEFAULT;\r
-\r
-// if (m_bNoDispUpdates)\r
-// return;\r
-\r
- // First thing - check the draw stage. If it's the control's prepaint\r
- // stage, then tell Windows we want messages for every item.\r
-\r
- if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )\r
- {\r
- *pResult = CDRF_NOTIFYITEMDRAW;\r
- }\r
- else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )\r
- {\r
- // This is the prepaint stage for an item. Here's where we set the\r
- // item's text color. Our return value will tell Windows to draw the\r
- // item itself, but it will use the new color we set here.\r
-\r
- // Tell Windows to paint the control itself.\r
- *pResult = CDRF_DODEFAULT;\r
-\r
- COLORREF crText = GetSysColor(COLOR_WINDOWTEXT);\r
- bool bGrayed = false;\r
-#if 0\r
- if ((m_cHidePaths.GetState() & 0x0003)==BST_INDETERMINATE)\r
- {\r
- if ((m_currentChangedArray)&&((m_currentChangedArray->GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec)))\r
- {\r
- //if ((*m_currentChangedArray)[(pLVCD->nmcd.dwItemSpec)]sPath.Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
- {\r
- crText = GetSysColor(COLOR_GRAYTEXT);\r
- bGrayed = true;\r
- }\r
- }\r
- else if (m_currentChangedPathList.GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec)\r
- {\r
- //if (m_currentChangedPathList[pLVCD->nmcd.dwItemSpec].GetGitPathString().Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
- {\r
- crText = GetSysColor(COLOR_GRAYTEXT);\r
- bGrayed = true;\r
- }\r
- }\r
- }\r
-\r
-#endif\r
- if ((!bGrayed)&&(m_currentChangedArray)&&(m_currentChangedArray->GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec))\r
- {\r
- DWORD action = ((*m_currentChangedArray)[pLVCD->nmcd.dwItemSpec]).m_Action;\r
- if (action == CTGitPath::LOGACTIONS_MODIFIED)\r
- crText = m_Colors.GetColor(CColors::Modified);\r
- if (action == CTGitPath::LOGACTIONS_REPLACED)\r
- crText = m_Colors.GetColor(CColors::Deleted);\r
- if (action == CTGitPath::LOGACTIONS_ADDED)\r
- crText = m_Colors.GetColor(CColors::Added);\r
- if (action == CTGitPath::LOGACTIONS_DELETED)\r
- crText = m_Colors.GetColor(CColors::Deleted);\r
- }\r
-\r
- // Store the color back in the NMLVCUSTOMDRAW struct.\r
- pLVCD->clrText = crText;\r
- }\r
-}\r
-\r