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 Tech Support » CExtTreeGridWnd::ItemInsert bug Collapse All
Subject Author Date
Offer Har Jan 8, 2009 - 10:57 AM

Dear Support,


Please run the application I sent you to reproduce the last bug I reported in ItemHide, and press the buttons in order, and then press button 4 four times. You will see that the tree lines are cut-off in the middle, I think that this hides a bigger bug.


Please fix.


Thanks,


Ron.


Technical Support Jan 8, 2009 - 2:37 PM

You can fix this by updating the following method:

void CExtTreeGridCellNode::TreeNodeHiddenSet(
            CExtTreeGridDataProvider & _DP,
            bool bHide
            )
{
            ASSERT_VALID( this );
            ASSERT_VALID( (&_DP) );
            ASSERT_KINDOF( CExtTreeGridDataProvider, (&_DP) );
bool bHidden = TreeNodeHiddenGet();
            if( ( bHidden && bHide ) || ( (!bHidden) && (!bHide) ) )
                        return;
            if( bHide )
            {
                        if( TreeNodeIsDisplayed() )
                        {
                                    ULONG nOffset = TreeNodeCalcOffset( true, false );
                                    if( nOffset != ULONG(-1L) )
                                    {
                                                ASSERT( _DP.m_arrGridVis[ nOffset ] == this );
                                                INT nCountToRemove = _ContentWeight_Get( true );
                                                _DP.m_arrGridVis.RemoveAt( nOffset, nCountToRemove + 1 );
                                                CExtTreeGridCellNode * pNodeParent = TreeNodeGetParent();
                                                if( pNodeParent != NULL )
                                                {
                                                            ASSERT_VALID( pNodeParent );
                                                            pNodeParent->_ContentWeight_Decrement( nCountToRemove + 1, true );
                                                }
                                    }
                        }
                        ModifyStyleEx( __EGCS_EX_HIDDEN_TREE_NODE, 0 );
            } // if( bHide )
            else
            {
                        ModifyStyleEx( 0, __EGCS_EX_HIDDEN_TREE_NODE );
                        if( TreeNodeIsDisplayed() )
                        {
                                    _ContentWeight_Adjust();
                                    ULONG nOffset = TreeNodeCalcOffset( true, false );
                                    if( nOffset != ULONG(-1L) )
                                    {
                                                m_nContentWeightAll = ULONG( m_arrChildren.GetSize() );
                                                INT nCountToInsert = _ContentWeight_CalcVisible();
                                                //INT nCountToInsert = _ContentWeight_Get( true );
//                                              ULONG nOffset = TreeNodeCalcOffset( true );
//                                              ASSERT( nWeightVisible >= pNode->TreeNodeGetChildCount() );
                                                _DP.m_arrGridVis.InsertAt( nOffset, NULL, nCountToInsert + 1 );
                                                _DP.m_arrGridVis.SetAt( nOffset, this );
                                                nOffset ++;
                                                _Content_FillVisibleArray( _DP.m_arrGridVis, nOffset );
//                                              CExtTreeGridCellNode * pNodeParent = TreeNodeGetParent();
//                                              if( pNodeParent != NULL )
//                                              {
//                                                          ASSERT_VALID( pNodeParent );
//                                                          pNodeParent->_ContentWeight_Increment( nCountToInsert + 1, true );
//                                              }
                                    }
                        }
            } // else from if( bHide )
}
This is not the final fix. We are working on a similar issue related to more complicated nested row layouts in report grid. The fix above is related to a tree grid only.