| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #include "stdafx.h"
- #include "PropertyGridInplaceEdit.h"
- #include "PropertyGridInplaceButton.h"
- #include "PropertyGridInplaceList.h"
- #include "PropertyGridItem.h"
- #include "PropertyGridItemButton.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CPropertyGridItemButton::CPropertyGridItemButton(CString strCaption, HWND hNotifyWnd, UINT nNotifyMsg)
- : CPropertyGridItem(strCaption)
- {
- ASSERT(hNotifyWnd);
- m_hNotifyWnd = hNotifyWnd;
- m_nNotifyMsg = nNotifyMsg;
- // 设置属性项风格:不可编辑,有按钮
- SetFlags(pgitemHasExpandButton);
- m_nFlags = pgitemHasEdit | pgitemHasExpandButton;
- }
- CPropertyGridItemButton::CPropertyGridItemButton(UINT nID, HWND hNotifyWnd, UINT nNotifyMsg)
- : CPropertyGridItem(nID)
- {
- ASSERT(hNotifyWnd);
- m_hNotifyWnd = hNotifyWnd;
- m_nNotifyMsg = nNotifyMsg;
- // 设置属性项风格:不可编辑,有按钮
- SetFlags(pgitemHasExpandButton);
- }
- CPropertyGridItemButton::~CPropertyGridItemButton()
- {
- }
- void CPropertyGridItemButton::OnInplaceButtonDown()
- {
- // 向指定窗口发送消息
- ::SendMessage(m_hNotifyWnd, m_nNotifyMsg, 0, 0);
- }
- void CPropertyGridItemButton::OnLButtonDblClk()
- {
- // 向指定窗口发送消息
- ::SendMessage(m_hNotifyWnd, m_nNotifyMsg, 0, 0);
- }
|