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 » Dynamic bars bug Collapse All
Subject Author Date
Rado Manzela May 31, 2010 - 2:25 AM

I’ve found bug in dynamic bars. (Tried also with latest 2.90) . Just run your SDI dynamic bars sample with clean registry to make default layout. Then drag out bar 19 to make it floating, drag 18 and paste to 19 to make it tabbed. Switch 18, then 19 back to tabbed document, then drag out 19 to make it floating. Then you will see above edit area of 18 tiny window you can resize to see it is some dummy Bar 18 window.

Rado Manzela Jun 1, 2010 - 3:17 AM

I’m afraid it is still not working. I’ve downloaded latest 2.90 (05-31) and applied this fix. When you repeat process I’ve sent to you, but then you will drag bar 18 (after 19) out of document tab, while dragging you will be suddenly dragging bar 18 tabbed with bar 19.


BTW when you’ll set bar 18 as tabbed document you will see it still flashes small dummy window for a moment until it is redrawn with other bars. Please try to play with bars little after fix :)

Technical Support Jun 2, 2010 - 11:35 AM

We cannot catch the small dummy window on the screen. We tried to take a look with attention at the screen area when the bar was floating last time. But we didn’t noticed any small floating bars there. Where the small bar window appears exactly for a short time on the screen?

Rado Manzela Jun 3, 2010 - 2:22 AM

It appears just for fraction of second so I cannot make screenshot. When you switch tab 19 to tabbed document as last step, it disappears and dummy window with height of title bar and width of maybe 6 pixels appears in upper left corner of floating bar 19 right under its title bar. But this is not important for me, I’ve thought it could be related to bug which I need to solve:


......drag bar 18 (after 19) out of document tab, while dragging you will be suddenly dragging bar 18 tabbed with bar 19.

Rado Manzela Jun 3, 2010 - 2:24 AM

PS. maybe it is visible only on windows xp, and on slower computer (I have Sempron 3400+ mobile)

Technical Support May 31, 2010 - 12:59 PM

Thank you for reporting this issue. To fix it, please update the source code for the following two methods:

bool CExtDynamicControlBar::OnStartDraggingDocumentTabItem(
            CExtTabWnd * pWndTab,
            LONG nTabItemIndex
            )
{
            ASSERT( this != NULL );
            ASSERT_VALID( pWndTab );
            pWndTab;
            nTabItemIndex;
            if( ! m_bEnableDndDocumentTabs )
                        return false;
            if( ! _DraggingIsEnabled( this ) )
                        return true;
CPoint point;
            if( ! ::GetCursorPos( &point ) )
                        return false;
            if( ! BarStateSet( __EDBS_DOCKED, false ) )
            {
                        ASSERT( FALSE );
                        return true;
            }
bool bShowContentWhenDragging = _IsShowContentWhenDragging();
CPoint ptFloat( point );
            ptFloat.x -= 15;
            ptFloat.y -= 45;
            ASSERT_VALID( m_pDockSite );
            m_pDockSite->ShowControlBar( this, TRUE, TRUE );
CExtControlBar * pFloatBar = this;
CFrameWnd * pParentFrame = GetParentFrame();
            ASSERT( pParentFrame != NULL );
            if( ! pParentFrame->IsKindOf( RUNTIME_CLASS(CExtMiniDockFrameWnd) ) )
            {
                        FloatControlBar( ptFloat );
                        pParentFrame = GetParentFrame();
            }
            else
            {
                        CExtDynControlBar * pDynBar = _GetNearestDynamicContainer();
                        for( ; pDynBar != NULL; pDynBar = pDynBar->_GetNearestDynamicContainer() )
                                    pFloatBar = pDynBar;
                        pFloatBar->FloatControlBar( ptFloat );
            }
            pParentFrame->RecalcLayout();
HWND hWndOwn = m_hWnd;
            if( pFloatBar != this )
            {
                        m_pDockSite->ShowControlBar( pFloatBar, TRUE, TRUE );
                        pFloatBar->OnRepositionSingleChild();
                        ::AfxGetApp()->OnIdle( 0 );
                        if( ! ( ::IsWindow(hWndOwn) && CWnd::FromHandlePermanent( hWndOwn ) == this ) )
                                    return false;
            }
            OnRepositionSingleChild();
CPoint ptOffset( point );
CRect rcWnd;
            pFloatBar->GetWindowRect( &rcWnd );
            ptOffset -= rcWnd.TopLeft();
            if( m_pDockSite->GetSafeHwnd() != NULL && ( ! bShowContentWhenDragging ) )
            {
                        ASSERT_VALID( m_pDockSite );
                        m_pDockSite->ShowControlBar( this, TRUE, FALSE );
            }
            pFloatBar->_DraggingStart( point, ptOffset );
            return true;
}

bool CExtDynamicControlBar::BarStateSet(
            CExtDynamicControlBar::eDynamicBarState_t eDBS,
            bool bShow
            )
{
            ASSERT_VALID( this );
            ASSERT_VALID( m_pDockSite );
//          if( m_eDBS == eDBS )
//                      return true;
            m_eHelperSwitchingDBS = eDBS;
            m_bHelperSwitchingIntoVisibleState = bShow;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
            if( eDBS == __EDBS_AUTO_HIDDEN && (!bShow) )
                        eDBS = __EDBS_DOCKED;
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
CExtDynamicBarSite * pDBS = GetBarSite();
            if( pDBS == NULL )
                        return false;
CExtDynamicBarSite::eDetectedUiType_t eDUIT = pDBS->GetDetectedUiType();
            switch( eDBS )
            {
            case __EDBS_FLOATING:
            {
                        m_bAppearInDockSiteControlBarPopupMenu = true;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
                        if( AutoHideModeGet() )
                                    AutoHideModeSet( false, false, false, true );
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
                        bool bFloating = IsFloating();
                        CExtMiniDockFrameWnd * pOldMiniDockFrameWndToHide = NULL;
                        HWND hWndOldMiniDockFrameWndToHide = NULL;
                        bool bHideOldFrame = false;
                        CFrameWnd * pParentFrame = GetParentFrame();
                        ASSERT( pParentFrame != NULL );
                        if( ! bFloating )
                        {
                                    pOldMiniDockFrameWndToHide = DYNAMIC_DOWNCAST( CExtMiniDockFrameWnd, pParentFrame );
                                    if( pOldMiniDockFrameWndToHide != NULL )
                                    {
                                                hWndOldMiniDockFrameWndToHide = pOldMiniDockFrameWndToHide->GetSafeHwnd();
                                                if( pOldMiniDockFrameWndToHide->_GetSingleVisibleBar() != this )
                                                            pOldMiniDockFrameWndToHide = NULL;
                                                else
                                                            bHideOldFrame = true;
                                    }
                        }
                        OnMoveChildToBar();
                        if( ! bFloating )
                                    FloatControlBar();
                        CControlBar::DelayShow( bShow ? TRUE : FALSE );
                        if(                     hWndOldMiniDockFrameWndToHide != NULL
                                    &&        pOldMiniDockFrameWndToHide == NULL
                                    &&        ::IsWindow( hWndOldMiniDockFrameWndToHide )
                                    )
                        {
                                    bHideOldFrame = false;
                                    pOldMiniDockFrameWndToHide = DYNAMIC_DOWNCAST( CExtMiniDockFrameWnd, CWnd::FromHandlePermanent( ( hWndOldMiniDockFrameWndToHide ) ) );
                        }
                        if( pOldMiniDockFrameWndToHide != NULL )
                        {
                                    if( bHideOldFrame )
                                                pOldMiniDockFrameWndToHide->ShowWindow( SW_HIDE );
                                    CWnd * pWnd = pOldMiniDockFrameWndToHide->GetDlgItem( AFX_IDW_DOCKBAR_FLOAT );
                                    if( pWnd != NULL )
                                    {
                                                pOldMiniDockFrameWndToHide->RepositionBars(0, 0xFFFF, AFX_IDW_DOCKBAR_FLOAT );
                                                pWnd = pWnd->GetWindow( GW_CHILD );
                                                if( pWnd != NULL )
                                                {
                                                            CExtDynControlBar * pDynControlBar = DYNAMIC_DOWNCAST( CExtDynControlBar, pWnd );
                                                            if( pDynControlBar != NULL )
                                                            {
                                                                        if( pDynControlBar->m_pWndDynDocker != NULL )
                                                                                    pDynControlBar->m_pWndDynDocker->OnDynamicLayoutOptimize();
                                                            }
                                                }
                                    }
                                    pOldMiniDockFrameWndToHide->RepositionBars( 0, 0xFFFF, AFX_IDW_DOCKBAR_FLOAT );
//                                  pOldMiniDockFrameWndToHide->RecalcLayout();
                        }
//                      if( ! bShow )
//                                  m_pDockSite->ShowControlBar( this, FALSE, FALSE );
//                      else
//                                  m_pDockSite->ShowControlBar( this, TRUE, FALSE );
                                    if(                     (! bShow ) && IsVisible()
                                                ||           bShow && (! IsVisible() )
                                                )
                                    {
                                                OnFrameBarCheckCmd( true ); // show/hide me
                                    }
                        GetParentFrame()->RecalcLayout();
            }
            break;
            case __EDBS_DOCKED:
            {
                        if( IsFloating() )
                        {
                                    m_bAppearInDockSiteControlBarPopupMenu = true;
                                    OnMoveChildToBar();
                                    DelayShow( bShow ? TRUE : FALSE );
//                      if( ! bShow )
//                                  m_pDockSite->ShowControlBar( this, FALSE, FALSE );
//                      else
//                                  m_pDockSite->ShowControlBar( this, TRUE, FALSE );
                                    if(                     (! bShow ) && IsVisible()
                                                ||           bShow && (! IsVisible() )
                                                )
                                    {
                                                OnFrameBarCheckCmd( true ); // show/hide me
                                    }
                                    GetParentFrame()->RecalcLayout();
                                    break;
                        }
                        CRect rcFrameWnd( 0, 0, 0, 0 );
                        CFrameWnd * pWndFrame = GetParentFrame();
                        CExtMiniDockFrameWnd * pWndMiniFrame = NULL;
                        CExtDynControlBar * pDynControlBar = NULL;
                        if( pWndFrame != NULL )
                        {
                                    pWndFrame->GetWindowRect( &rcFrameWnd );
                                    pWndMiniFrame = DYNAMIC_DOWNCAST( CExtMiniDockFrameWnd, pWndFrame );
                                    if( pWndMiniFrame != NULL )
                                    {
                                                pWndMiniFrame->ModifyStyle( FWS_SNAPTOBARS, 0 );
                                                CWnd * pWnd = pWndMiniFrame->GetDlgItem( AFX_IDW_DOCKBAR_FLOAT );
                                                if( pWnd != NULL )
                                                {
                                                            pWnd = pWnd->GetWindow( GW_CHILD );
                                                            if( pWnd != NULL )
                                                                        pDynControlBar = DYNAMIC_DOWNCAST( CExtDynControlBar, pWnd );
                                                }
                                    }
                        }
                        m_bAppearInDockSiteControlBarPopupMenu = true;
                        OnMoveChildToBar();
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
                        if( AutoHideModeGet() )
                        {
                                    AutoHideModeSet( false, false, true, true );
                                    if( bShow )
                                                OnFrameBarCheckCmd( false ); // show me
                        } // if( AutoHideModeGet() )
                        else
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
                        {
                                    if( bShow )
                                                m_eDBS = eDBS; // for making OnQueryVisibilityInContainerTabs() returning true
                                    if(                     (! bShow ) && IsVisible()
                                                ||           bShow && (! IsVisible() )
                                                )
                                                OnFrameBarCheckCmd( true ); // show/hide me
                                    if( pWndMiniFrame != NULL )
                                    {
                                                CWnd * pWnd = pWndMiniFrame->GetDlgItem( AFX_IDW_DOCKBAR_FLOAT );
                                                if( pWnd != NULL )
                                                {
                                                            pWndFrame->MoveWindow( &rcFrameWnd );
                                                            pWndMiniFrame->RepositionBars(0, 0xFFFF, AFX_IDW_DOCKBAR_FLOAT );
                                                            if( pDynControlBar != NULL )
                                                                        pDynControlBar->OnRepositionSingleChild();
                                                }
                                                pWndFrame->RecalcLayout();
                                    }
                        } // else from if( AutoHideModeGet() )
            }
            break;
            case __EDBS_DOCUMENT:
                        if( OnQueryChildHWND() == NULL )
                        {
                                    ASSERT( FALSE );
                                    return false;
                        } // if( OnQueryChildHWND() == NULL )
                        if( eDUIT == CExtDynamicBarSite::__EDUIT_UNSUPPORTED_ENVIRONMENT )
                        {
                                    ASSERT( FALSE );
                                    return false;
                        } // if( OnQueryChildHWND() == NULL )
                        m_bAppearInDockSiteControlBarPopupMenu = false;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
                        if( AutoHideModeGet() )
                                    AutoHideModeSet( false, false, false, true );
                        else
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
                                    if( IsVisible() )
                                    {
                                                OnFrameBarCheckCmd( true ); // hide me
                                                GetParentFrame()->RecalcLayout();
                                    }
                        if( bShow )
                                    OnMoveChildToDocument();
                        else
                                    OnMoveChildToBar();
            break;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
            case __EDBS_AUTO_HIDDEN:
                        m_bAppearInDockSiteControlBarPopupMenu = true;
                        ASSERT( bShow );
                        if( ! AutoHideModeGet() )
                        {
                                    OnMoveChildToBar();
                                    if(                     IsFloating()
                                                ||           GetParentFrame() != m_pDockSite
                                                )
                                    {
                                                VERIFY(
                                                            DockControlBarInnerOuter(
                                                                        AFX_IDW_DOCKBAR_LEFT,
                                                                        false,
                                                                        m_pDockSite,
                                                                        false
                                                                        )
                                                            );
                                    }
                                    VERIFY(
                                                AutoHideModeSet(
                                                            true,
                                                            false,
                                                            true,
                                                            false
                                                            )
                                                );
                        } // if( ! AutoHideModeGet() )
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
            break;
#ifdef _DEBUG
            default:
                        {
                                    ASSERT( FALSE );
                        }
            break;
#endif // _DEBUG
            } //switch( eDBS )
            m_eDBS = eDBS;
            if( bShow )
                        m_dwAdditionalStateFlags &= ~__EASF_INVISIBLE;
            else
                        m_dwAdditionalStateFlags |= __EASF_INVISIBLE;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
//          if( eDBS != __EDBS_DOCUMENT && eDBS != __EDBS_FLOATING )
            if( eDBS == __EDBS_AUTO_HIDDEN )
            {
                        CExtDockDynTabBar * pDynDockBar =
                                    DYNAMIC_DOWNCAST(
                                                CExtDockDynTabBar,
                                                GetParent()
                                                );
                        if( pDynDockBar != NULL )
                        {
                                    CExtDynTabControlBar * pTabbedBar =
                                                DYNAMIC_DOWNCAST(
                                                            CExtDynTabControlBar,
                                                            pDynDockBar->GetParent()
                                                            );
                                    LONG nPos, nCount = pTabbedBar->GetSwitcherItemCount();
                                    for( nPos = 0; nPos < nCount; nPos++ )
                                    {
                                                CExtControlBar * pContainedBar = pTabbedBar->GetBarAt( nPos, true );
                                                CExtDynamicControlBar * pDynamicBar = DYNAMIC_DOWNCAST( CExtDynamicControlBar, pContainedBar );
                                                if( pDynamicBar != NULL )
                                                            pDynamicBar->m_eDBS = eDBS;
                                    } // for( nPos = 0; nPos < nCount; nPos++ )
                        } // if( pDynDockBar != NULL )
            }
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
            return true;
}