Keep Category Expanded |
Post Reply |
Author | |
AliRafiee
Groupie Joined: 06 May 2004 Status: Offline Points: 32 |
Post Options
Thanks(0)
Posted: 09 January 2006 at 3:47pm |
Is there a way to pervent the user from Collapsing a category? I ended up making the following changes to get it to do that.
CXTPPropertyGridItem* CXTPPropertyGridView::InsertCategory(int nIndex, CString strCaption, CXTPPropertyGridItem* pCategory) { ..... pCategory->m_nFlags = xtpGridItemHasExpandButton; ... } void { .... if (pItem->HasChilds() && pItem->GetFlags() & xtpGridItemHasExpandButton) { CRgn rgn; if (!pItem->IsCategory()) { rgn.CreateRectRgnIndirect(&rcCaption); dc.SelectClipRgn(&rgn); } DrawExpandButton(dc, pItem, rcCaption); dc.SelectClipRgn(NULL); } } BOOL CXTPPropertyGridItem::OnLButtonDown(UINT, CPoint point) { .... if(point.x >= nOffset && point.x <= XTP_PGI_EXPAND_BORDER + nOffset && m_nFlags & xtpGridItemHasExpandButton) { if(m_bExpanded) Collapse(); else Expand(); } AFX_INLINE void CXTPPropertyGridItem::SetFlags(UINT nFlags) { // ASSERT(!m_bCategory); ASSERT((nFlags & (xtpGridItemHasComboButton | xtpGridItemHasExpandButton)) != (xtpGridItemHasComboButton | xtpGridItemHasExpandButton)); m_nFlags = nFlags; }
Ali |
|
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 |