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 » Active CExtDynamicControlBar in a tab container Collapse All
Subject Author Date
Jean-Yves Tremblay Mar 14, 2007 - 2:46 PM

Dear support,

I have a set of CExtDynamicControlBar docked in a tab container.

Each CExtDynamicControlBar has a child window (CFormView-derived)

I would like to know, from the view, if its parent is the active/focused control bar in the tab container.

How should I do that ?

I tried with CExtDynamicControlBar::BarStateGet (Checking p_bIsVisibleState) and
CExtDynamicControlBar::OnQueryVisibilityInContainerTabs
but all the control bars are always visible.

Thank you.

Technical Support Mar 15, 2007 - 2:13 PM

You should use the following code:

CFormView * pView = . . .
CExtControlBar * pBar = DYNAMIC_DOWNCAST(CExtControlBar, pView->GetParent() );
      If( pBar == NULL )
            return . . . // we are in the document mode
      if( pBar->IsVisible() )
            return . . . // bar is hidden or auto-hidden
CExtDynTabControlBar * pTabbed = pBar->_GetNearestTabbedContainer();
      If( pTabbed == NULL )
            return . . . // bar is not in the tabbed group
LONG nSelectedTabIndex = pTabbed->GetSwitcherSelection();
      If( nSelectedTabIndex < 0 )
            return . . . // this can happen only during bar drag-n-drop
CExtControlBar * pSelectedBar = pTabbed->GetBarAt( nSelectedTabIndex, false );
      If( pSelectedBar != pBar )
            return . . . // our pBar is not selected in the tab group
      // if we are here then pView is in the in-group active bar