EGPropertyGridItemStatic.cpp
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 2k
Category:

Graph program

Development Platform:

Visual C++

  1. // PropTreeItemStatic.cpp
  2. //
  3. //  Copyright (C) 1998-2001 Scott Ramsay
  4. // sramsay@gonavi.com
  5. // http://www.gonavi.com
  6. //
  7. //  This material is provided "as is", with absolutely no warranty expressed
  8. //  or implied. Any use is at your own risk.
  9. // 
  10. //  Permission to use or copy this software for any purpose is hereby granted 
  11. //  without fee, provided the above notices are retained on all copies.
  12. //  Permission to modify the code and to distribute modified code is granted,
  13. //  provided the above notices are retained, and a notice that the code was
  14. //  modified is included with the above copyright notice.
  15. // 
  16. // If you use this code, drop me an email.  I'd like to know if you find the code
  17. // useful.
  18. #include "stdafx.h"
  19. #include "EGPropertyGrid.h"
  20. #include "EGPropertyGridItemStatic.h"
  21. CEGPropertyGridItemStatic::CEGPropertyGridItemStatic() :
  22. m_sAttribute(_T(""))
  23. {
  24. }
  25. CEGPropertyGridItemStatic::~CEGPropertyGridItemStatic()
  26. {
  27. }
  28. void CEGPropertyGridItemStatic::DrawAttribute(CDC* pDC, const RECT& rc)
  29. {
  30. ASSERT(m_pProp!=NULL);
  31. pDC->SelectObject(m_pProp->GetNormalFont());
  32. pDC->SetTextColor(RGB(0,0,0));
  33. pDC->SetBkMode(TRANSPARENT);
  34. CRect r = rc;
  35. pDC->DrawText(m_sAttribute, r, DT_SINGLELINE|DT_VCENTER);
  36. }
  37. LPARAM CEGPropertyGridItemStatic::GetItemValue()
  38. {
  39. return (LPARAM)(LPCTSTR)m_sAttribute;
  40. }
  41. void CEGPropertyGridItemStatic::SetItemValue(LPARAM lParam)
  42. {
  43. if (lParam==0L)
  44. {
  45. TRACE0("CEGPropertyGridItemStatic::SetItemValue() - Invalid lParam valuen");
  46. return;
  47. }
  48. m_sAttribute = (LPCTSTR)lParam;
  49. }