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 » Strange behaviour within Ribbon sample? Collapse All
Subject Author Date
Oliver Rau Oct 26, 2009 - 9:31 AM

Dear ProfUIS-Team,

there seems to occur some strange behaviour with your Ribbon(MDI) demo. It could be reproduced without code modifications for versions 2.82 and 2.85.

Opening the about-dialog (which is obviously meant to be modal) and leaving the focus of this dialog, i.e. moving mouse pointer outside, you can wheel-scroll through the ribbon tabpages. Also, if being fast enough, you can catch some focus within the ribbonbar, i.e. some of the buttons appear to be active for a short time.

As I can’t imagine that this is an intended feature, I’d like to let you know.

Best regards,

Martin

Technical Support Oct 26, 2009 - 2:17 PM

Thank you for reporting this issue. We fixed it in the following method:

bool CExtRibbonBar::OnRibbonProcessMouseWheel( UINT fFlags, short zDelta, CPoint point )
{
            ASSERT_VALID( this );
            fFlags;
            point;
            if( GetSafeHwnd() == NULL )
                        return false;
            if( zDelta == 0 )
                        return false;
            if( ! RibbonPage_ExpandedModeGet() )
                        return false;
            if( m_bFlatTracking )
                        return false;
            if( ( GetStyle() & WS_DISABLED ) != 0 )
                        return false;
CWnd * pWnd = GetParent();
            if(                     pWnd != NULL
                        &&        ( pWnd->GetStyle() & WS_DISABLED ) != 0
                        )
                        return false;
INT nIndex, nCount = RibbonTabPageButton_GetCount();
            if( nCount <= 1 )
                        return false;
HWND hWndFocus = ::GetFocus();
            if(                     hWndFocus != NULL
                        &&        (           hWndFocus == m_hWnd
                                    ||           ::IsChild( m_hWnd, hWndFocus )
                                    )
                        )
                        return false;
bool bNext = ( int(zDelta) < 0 ) ? true : false;
CExtRibbonButtonTabPage * pNewSelTBB = NULL;
bool bSelPassed = false;
            for( nIndex = 0; nIndex < nCount; nIndex ++ )
            {
                        CExtRibbonButtonTabPage * pTBB = RibbonTabPageButton_GetAt( nIndex );
                        ASSERT_VALID( pTBB );
                        if( pTBB->IsSelectedRibbonPage() )
                        {
                                    bSelPassed = true;
                                    continue;
                        }
                        if( ! pTBB->OnQueryFlatTrackingEnabled() )
                                    continue;
                        if( bSelPassed )
                        {
                                    if( bNext )
                                    {
                                                if( pNewSelTBB == NULL )
                                                {
                                                            pNewSelTBB = pTBB;
                                                            break;
                                                }
                                    }
                                    else
                                                break;
                        } // if( bSelPassed )
                        else
                        {
                                    if( bNext )
                                                continue;
                                    pNewSelTBB = pTBB;
                        } // else from if( bSelPassed )
            } // for( nIndex = 0; nIndex < nCount; nIndex ++ )
            if( pNewSelTBB == NULL )
                        return false;
            Invalidate();
            if( m_bFlatTracking )
            {
                        m_bFlatTracking = false;
                        OnFlatTrackingStop();
            } // if( m_bFlatTracking )
            _UpdateFlatTracking( false );
INT nPageIndex, nPageCount = RibbonTabPageButton_GetCount();
            for( nPageIndex = 0; nPageIndex < nPageCount; nPageIndex ++ )
            {
                        CExtRibbonButtonTabPage * pTabPageTBB = RibbonTabPageButton_GetAt( nPageIndex );
                        ASSERT( pTabPageTBB );
                        pTabPageTBB->SetHover( false );
                        pTabPageTBB->ModifyStyle( 0, TBBS_PRESSED|TBBS_CHECKED );
            } // for( . . .
            _UpdateHoverButton( CPoint(-1,-1), false );
            pNewSelTBB->OnDeliverCmd();
            return true;
}