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 » CExtRichContentScrollWnd - problems Collapse All
Subject Author Date
Alastair Watts Apr 6, 2011 - 6:43 AM

Other windows located below a CExtRichContentScrollWnd become in-accessable when there is undisplayed horizontal content to the bottom.  Interestly, the area that becomes in-accessable is directly related the size of undisplayed scroll content.


I’ve also noticed that sometimes the scrollbars don’t work having just re-sized the control.

Technical Support Apr 6, 2011 - 12:00 PM

Thank you very much for reporting this issue. To fix it, please update the source code for the following method:

bool CExtRichContentScrollWnd::OnRcsAnalyzeMouseMoveEvent(
    UINT nFlags, // mouse event flags
    CPoint point // mouse pointer in client coordinates
    )
{
    ASSERT_VALID( this );
    nFlags;
    if( m_bPressedTracking )
        return true;
CExtRichContentLayout * pRCL = RcsLayoutGet();
CExtRichContentItem * pRootRCI = ( pRCL->m_listHeap.GetCount() > 0 ) ? pRCL->m_listHeap.GetHead() : NULL;
    if( pRootRCI == NULL )
    {
        if( ! m_htInfoHover.IsEmpty() )
        {
            m_htInfoHover.Empty();
            RcsDelayRecalcLayout();
            OnSwRecalcLayout( true );
            OnSwUpdateScrollBars();
            OnSwInvalidate( m_bRedrawErase );
        } // if( ! m_htInfoHover.IsEmpty() )
        return true;
    } // if( pRootRCI == NULL )

CPoint ptScreen( point );
    ClientToScreen( &ptScreen );
HWND hWndFromPoint = ::WindowFromPoint( ptScreen );
CExtRichContentHitTestInfo htInfoHover( point + OnSwGetScrollPos(), *pRCL );
    if( hWndFromPoint == m_hWnd ) // do hit testing only in this case
        htInfoHover.HitTest();
//    if( m_htInfoHover == htInfoHover )
//        return true;
bool bQuickReStyleMode = ( ( RcsGetStyle() & __EXT_RCS_QUICK_RESTYLE_MODE ) ) ? true : false;
CExtRichStyleDescription::pseudo_class_def_t statesHoverOnly;
    statesHoverOnly.m_eynHover = CExtRichStyleDescription::e_ui_yn_yes;
POSITION pos1 = m_htInfoHover.m_listHtBranch.GetHeadPosition();
POSITION pos2 = htInfoHover.m_listHtBranch.GetHeadPosition();
#ifdef _DEBUG
POSITION pos1r = NULL;
#endif // _DEBUG
POSITION pos2r = NULL;
bool bHaveEqualTop = true, bHaveElementsWithResetStyles = false;
CExtRichContentItem * pResetStyleRCI;
    for( pResetStyleRCI = NULL; pos1 != NULL; )
    {
        if( bHaveEqualTop )
        {
#ifdef _DEBUG
            pos1r = pos1;
#endif // _DEBUG
            pos2r = pos2;
        }
        CExtRichContentHitTestInfo::ht_item_t & _ht_item1 = m_htInfoHover.m_listHtBranch.GetNext( pos1 );
        __EXT_DEBUG_RICH_CONTENT_ASSERT( _ht_item1.m_pRCI != NULL );
        if( pos2 != NULL && bHaveEqualTop )
        {
            CExtRichContentHitTestInfo::ht_item_t & _ht_item2 = htInfoHover.m_listHtBranch.GetNext( pos2 );
            __EXT_DEBUG_RICH_CONTENT_ASSERT( _ht_item2.m_pRCI != NULL );
            if( _ht_item1.m_pRCI == _ht_item2.m_pRCI )
                continue;
            else
                bHaveEqualTop = false;
        }
        else
            bHaveEqualTop = false;
        _ht_item1.m_pRCI->RciEvent_OnMouseLeave( m_htInfoHover, htInfoHover, m_hWnd );
        _ht_item1.m_pRCI->ResetElementStateInfo( statesHoverOnly, CExtRichStyleDescription::e_ui_yn_unspecified );
        if( _ht_item1.m_pRCI->HaveAffectedCssPseudoClasses( statesHoverOnly ) )
        {
            bHaveElementsWithResetStyles = true;
            pResetStyleRCI = _ht_item1.m_pRCI;
        }
    } // for( pResetStyleRCI = NULL; pos1 != NULL; )
    if( pResetStyleRCI != NULL )
        OnRcsResetElementStyle( pResetStyleRCI );
    if( ! bHaveEqualTop )
#ifdef _DEBUG
        pos1r =
#endif // _DEBUG
            pos2r = NULL;
    __EXT_DEBUG_RICH_CONTENT_ASSERT( ( pos1r != NULL && pos2r != NULL ) || ( pos1r == NULL && pos2r == NULL ) );
//    pos1 = ( pos1r != NULL ) ? pos1r : m_htInfoHover.m_listHtBranch.GetHeadPosition();
    pos2 = ( pos2r != NULL ) ? pos2r : htInfoHover.m_listHtBranch.GetHeadPosition();
#ifdef _DEBUG
    pos1r;
#endif // _DEBUG
    for( pResetStyleRCI = NULL; pos2 != NULL; )
    {
        CExtRichContentHitTestInfo::ht_item_t & _ht_item2 = htInfoHover.m_listHtBranch.GetNext( pos2 );
        __EXT_DEBUG_RICH_CONTENT_ASSERT( _ht_item2.m_pRCI != NULL )
        _ht_item2.m_pRCI->ResetElementStateInfo( statesHoverOnly, CExtRichStyleDescription::e_ui_yn_yes );
        if( _ht_item2.m_pRCI->HaveAffectedCssPseudoClasses( statesHoverOnly ) )
        {
            bHaveElementsWithResetStyles = true;
            pResetStyleRCI = _ht_item2.m_pRCI;
        }
        _ht_item2.m_pRCI->RciEvent_OnMouseEnter( m_htInfoHover, htInfoHover, m_hWnd );
    } // for( pResetStyleRCI = NULL; pos2 != NULL; )
    if( pResetStyleRCI != NULL )
        OnRcsResetElementStyle( pResetStyleRCI );

    m_htInfoHover = htInfoHover;

    if( htInfoHover.IsEmpty() )
    {
        if( ::GetCapture() == m_hWnd )
            ::ReleaseCapture();
    }
    else
    {
        if( ::GetCapture() != m_hWnd )
            ::SetCapture( m_hWnd );
    }

bool bSbInvalidate = false;
    if( m_pRCI_ScrollBarTracking != NULL )
    {
        m_pRCI_ScrollBarTracking->m_nSBMHT = INT(CExtPaintManager::__ESBMHT_NOWHERE);
        m_pRCI_ScrollBarTracking->m_bSbProcessingClick = false;
        m_pRCI_ScrollBarTracking->m_bSbProcessingOutClick = false;
        m_pRCI_ScrollBarTracking->m_bSbProcessingHover = false;
        bSbInvalidate = true;
        m_pRCI_ScrollBarTracking = NULL;
    }
    m_pHtItemScrollBarTracking = NULL;
    if(        htInfoHover.m_listHtBranch.GetCount() > 0
        &&    ( ( htInfoHover.m_listHtBranch.GetTail().m_dwHtFlags & __ERCHT_ON_ANY_SCROLL_BAR ) != 0 )
        &&    ( ( htInfoHover.m_listHtBranch.GetTail().m_dwHtFlags & __ERCHT_ON_SB_DISABLED ) == 0 )
        )
    { // if scroll bar part is hovered
        const CExtRichContentHitTestInfo::ht_item_t & _ht_item = htInfoHover.m_listHtBranch.GetTail();
        ASSERT( ( _ht_item.m_dwHtFlags & (__ERCHT_ON_ANY_SCROLL_BAR|__ERCHT_ON_SB_DISABLED) ) != 0 );
        m_pHtItemScrollBarTracking = const_cast < CExtRichContentHitTestInfo::ht_item_t * > ( &_ht_item );
        m_pRCI_ScrollBarTracking = m_pHtItemScrollBarTracking->m_pRCI;
        CExtPaintManager::PAINTSCROLLBARDATA _psbd;
        m_pRCI_ScrollBarTracking->Scrolling_FillScrollBarInfo( _ht_item.m_pRCI->m_bHorzScrollBarTracking, _ht_item.m_rcPart, &_psbd );
        _psbd.AdjustHT( htInfoHover.m_ptHT );
        m_pRCI_ScrollBarTracking->m_nSBMHT = INT(_psbd.m_eSBMHT);
        m_pRCI_ScrollBarTracking->m_bSbProcessingClick = false;
        m_pRCI_ScrollBarTracking->m_bSbProcessingOutClick = false;
        m_pRCI_ScrollBarTracking->m_bSbProcessingHover = true;
        bSbInvalidate = true;
    } // if scroll bar part is hovered
    if( bHaveElementsWithResetStyles )
        bSbInvalidate = true;
    if( bSbInvalidate )
        OnSwInvalidate( m_bRedrawErase );
    if( ! bHaveElementsWithResetStyles )
        return true;
    if( ! bQuickReStyleMode )
    {
        RcsDelayRecalcLayout();
        if( bSbInvalidate )
        {
            OnSwRecalcLayout( true );
            OnSwUpdateScrollBars();
        }
    }
    return true;
}