Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtPropertyValueCompound, collapse button Collapse All
Subject Author Date
a a Feb 9, 2006 - 12:25 AM

Is there a way to make the collapse button of a CExtPropertyValueCompound put in the root of a property store always visible?
When it is not put in a category, we can’t see it (in categorized mode).


Thanks.

Technical Support Feb 9, 2006 - 10:11 AM

We have improved the source code of the CExtPropertyGridWnd::OnGbwAdjustRects() virtual method which shifts the content of the compound property value’s sub tree if the compound property value is inserted into the top level of the property store. You will see that the expand box appears correctly. Here is the method’s source code:

void CExtPropertyGridWnd::OnGbwAdjustRects(
    LONG nColNo,
    LONG nRowNo,
    INT nColType,
    INT nRowType,
    RECT & rcCellExtraA,
    RECT & rcCellA
    ) const
{
    ASSERT_VALID( this );
bool bOutlinedColumn =
        (    nColType == 0
        &&    nRowType == 0
        &&    OnTreeGridQueryColumnOutline( nColNo )
        ) ? true : false;
    if(        bOutlinedColumn
        &&    m_nConstantIndent >= 0
        )
    {
        rcCellA.left += m_nConstantIndent;
    }
    else
        CExtTreeGridWnd::OnGbwAdjustRects(
            nColNo,
            nRowNo,
            nColType,
            nRowType,
            rcCellExtraA,
            rcCellA
            );
    if( nColType == 0 && nRowType == 0 )
    {
        HTREEITEM hTreeItem =
            ItemGetByVisibleRowIndex( nRowNo );
        ASSERT( hTreeItem != NULL );
        const CExtPropertyItem * pPropertyItem =
            PropertyItemFromTreeItem( hTreeItem );
        ASSERT_VALID( pPropertyItem );
        if( pPropertyItem->IsKindOf(RUNTIME_CLASS(CExtPropertyCategory)) )
        {
            CRect rcClient = OnSwGetClientRect();
            if( nColNo == 1 )
                rcCellA.left = rcCellExtraA.left = rcClient.right;
            else
                rcCellA.right = rcCellExtraA.right = rcClient.right;
        } // if( pPropertyItem->IsKindOf(RUNTIME_CLASS(CExtPropertyCategory)) )
        if(        bOutlinedColumn
            &&    m_nConstantIndent < 0
            )
        {
            const CExtPropertyItem * pWalk = pPropertyItem;
            for( ; true; )
            {
                const CExtPropertyItem * pParent = pWalk->ItemParentGet();
                if( pParent == NULL )
                    break;
                if(        (    pWalk->IsKindOf(RUNTIME_CLASS(CExtPropertyValueCompound))
                        ||    pWalk->IsKindOf(RUNTIME_CLASS(CExtPropertyValueMixedCompound))
                        )
                    &&    pParent->IsKindOf( RUNTIME_CLASS(CExtPropertyStore) )
                    )
                {
                    rcCellA.left += GetTreeData().m_nIndentPxDefault;
                    break;
                }
                pWalk = pParent;
            } // for( ; true; )
        }
    } // if( nColType == 0 && nRowType == 0 )
}


a a Feb 9, 2006 - 6:17 PM

Thanks.