PropertyGridItemStringButton.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "stdafx.h"
  2. #include "PropertyGridInplaceEdit.h"
  3. #include "PropertyGridInplaceButton.h"
  4. #include "PropertyGridInplaceList.h"
  5. #include "PropertyGridItem.h"
  6. #include "PropertyGridItemStringButton.h"
  7. //////////////////////////////////////////////////////////////////////
  8. // Construction/Destruction
  9. //////////////////////////////////////////////////////////////////////
  10. CPropertyGridItemStringButton ::CPropertyGridItemStringButton (CString strCaption, LPCTSTR strValue, HWND hNotifyWnd , UINT nNotifyMsg )
  11. : CPropertyGridItem(strCaption)
  12. {
  13. ASSERT(hNotifyWnd);
  14. m_hNotifyWnd = hNotifyWnd;
  15. m_nNotifyMsg = nNotifyMsg;
  16. }
  17. CPropertyGridItemStringButton::CPropertyGridItemStringButton(UINT nID, LPCTSTR strValue, HWND hNotifyWnd , UINT nNotifyMsg )
  18. : CPropertyGridItem(nID)
  19. {
  20. ASSERT(hNotifyWnd);
  21. m_hNotifyWnd = hNotifyWnd;
  22. m_nNotifyMsg = nNotifyMsg;
  23. }
  24. CPropertyGridItemStringButton::~CPropertyGridItemStringButton()
  25. {
  26. }
  27. void CPropertyGridItemStringButton::OnInplaceButtonDown()
  28. {
  29. // 向指定窗口发送消息
  30. ::SendMessage(m_hNotifyWnd, m_nNotifyMsg, 0, 0);
  31. }
  32. void CPropertyGridItemStringButton::OnLButtonDblClk()
  33. {
  34. // 向指定窗口发送消息
  35. //::SendMessage(m_hNotifyWnd, m_nNotifyMsg, 0, 0);
  36. }