Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.7 KiB

  1. // CODE WHICH I REMOVED BUT THAT I'M AFRAID TO THROW AWAY IN CASE I NEED IT
  2. //
  3. // NOT IN THE BUILD
  4. /*++ CPerfPage::DrawLegend
  5. Routine Description:
  6. Draws the legend on the performance page
  7. Arguments:
  8. lpdi - LPDRAWITEMSTRUCT describing area we need to paint
  9. Return Value:
  10. Revision History:
  11. Jan-18-95 Davepl Created
  12. --*/
  13. void CPerfPage::DrawLegend(LPDRAWITEMSTRUCT lpdi)
  14. {
  15. int xPos = 10; // X pos for drawing
  16. const int yLine = 6; // Y pos for drawing the lines
  17. const int yText = 0; // Y pos for drawing the text
  18. const int LineLen = 10; // Length of legend lines
  19. FillRect(lpdi->hDC, &lpdi->rcItem, (HBRUSH) GetStockObject(GRAPH_BRUSH));
  20. SetBkColor(lpdi->hDC, RGB(0,0,0));
  21. SetTextColor(lpdi->hDC, aColors[MEM_PEN]);
  22. SelectObject(lpdi->hDC, m_hPens[MEM_PEN]);
  23. MoveToEx(lpdi->hDC, xPos, yLine, (LPPOINT) NULL);
  24. xPos += LineLen;
  25. LineTo(lpdi->hDC, xPos, yLine);
  26. xPos += 5;
  27. xPos = TextToLegend(lpdi->hDC, xPos, yText, g_szMemUsage) + 10;
  28. {
  29. static const LPCTSTR pszLabels[2] = { g_szTotalCPU, g_szKernelCPU };
  30. for (int i = 0; i < 2; i++)
  31. {
  32. SetTextColor(lpdi->hDC, aColors[i]);
  33. SelectObject(lpdi->hDC, m_hPens[i]);
  34. MoveToEx(lpdi->hDC, xPos, yLine, (LPPOINT) NULL);
  35. xPos += LineLen;
  36. LineTo(lpdi->hDC, xPos, yLine);
  37. xPos += 5;
  38. xPos = TextToLegend(lpdi->hDC, xPos, yText, pszLabels[i]) + 10;
  39. // Don't both with the kernel legend unless needed
  40. if (FALSE == g_Options.m_fKernelTimes)
  41. {
  42. break;
  43. }
  44. }
  45. }
  46. }