CButton Custom item |
Post Reply |
Author | |
Patrick
Newbie Joined: 12 June 2005 Location: United States Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 12 June 2005 at 10:46pm |
I would like to create a custom item that is a simple command button (CButton). I would like the button always to be visible (e.g., even if it has not been selected) unless its category is collapsed, and receive an event when the button is clicked. I have a partially working version but it does not property hide or show itself when its category is expanded or collapsed. Thanks in advance for any help. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
We added this sample to PropertyGrid sample for next release. After item expnaded/collapsed SetVisible is called. You can override it and test m_bVisible state. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Patrick
Newbie Joined: 12 June 2005 Location: United States Status: Offline Points: 4 |
Post Options
Thanks(0)
|
oleg, Thank you for the quick reply! When will the sample code be available and how may I obtain it? Is it possible to get it now? By the way, your product is outstanding! The best object model and implementation I have seen in any off the shelf visual component. Thanks again, Patrick
|
|
Patrick
Newbie Joined: 12 June 2005 Location: United States Status: Offline Points: 4 |
Post Options
Thanks(0)
|
The following code represents my solution. It will be interesting to see how different it is from the future sample code. // Patrick class CCustomItemCommandBtn; class CInplaceCommandBtn : public CButton DECLARE_MESSAGE_MAP() protected: friend class CCustomItemCommandBtn; class CCustomItemCommandBtn : public CXTPPropertyGridItem protected: protected: friend class CInplaceCommandBtn; //Patrick // CCustomItemCommandBtn
HBRUSH CInplaceCommandBtn::CtlColor(CDC* pDC, UINT /*nCtlColor*/) CGridView* pGrid = (CGridView*)m_pItem->m_pGrid; COLORREF clr = pGrid->m_clrBack; if (clr != m_clrBack || !m_brBack.GetSafeHandle()) pDC->SetBkColor(m_clrBack); LRESULT CInplaceCommandBtn::OnClick(WPARAM wParam, WPARAM lParam) void CInplaceCommandBtn::OnMove(int, int)
void CCustomItemCommandBtn::Create() BOOL CCustomItemCommandBtn::OnDrawItemValue(CDC&, CRect) void CCustomItemCommandBtn::SetVisible(BOOL bVisible)
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |