Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Keep Category Expanded
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Keep Category Expanded

 Post Reply Post Reply
Author
Message
AliRafiee View Drop Down
Groupie
Groupie


Joined: 06 May 2004
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote AliRafiee Quote  Post ReplyReply Direct Link To This Post Topic: Keep Category Expanded
    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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.