Print Page | Close Window

Keep Category Expanded

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=3493
Printed Date: 21 May 2024 at 10:05pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Keep Category Expanded
Posted By: AliRafiee
Subject: Keep Category Expanded
Date 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 CXTPPropertyGridPaintManager::DrawItem(PDRAWITEMSTRUCT lpDrawItemStruct)

{

....

   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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net