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 Jun 4, 2010 - 5:38 AM

Please try to run SDI dynamic bar sample. Then click to header of some bar which is set as tabbed document and hold the click. Start to move cursor to left very slowly. In some UI themes at 6th pixel the bar disappears. In other themes it creates 2 partially drawn floating bars. When you move it to next pixel, everything is fixed. But when you release left button at 6th pixel in themes where the bar is hidden, it stays hidden. Can you fix it please? Thank you.

Technical Support Jun 10, 2010 - 9:01 AM

Thank you for reporting this issue. You can fix it by updating the source code for the following method:

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->ShowWindow( SW_SHOWNA );
            pParentFrame->DelayRecalcLayout();
            pParentFrame->SendMessage( WM_IDLEUPDATECMDUI );
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;
}