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 » Locking CExtControlBar Collapse All
Subject Author Date
claude laflamme Mar 24, 2006 - 12:05 PM

Hi,
I would like to prevent my controlbar to be redocked using a single flag as m_bLockBars. The idea is to place window for our needs and then we lock the interface to be sure they still keep their position. I’ve tried to ovveride the _DraggingStart method but it didn’t work. What should I do?

Tanks

Technical Support Mar 25, 2006 - 5:07 AM

To lock a control bar, you need to override two virtual methods of the CExtControlBar, CExtToolControlBar, or CExtMenuControlBar class: _DraggingStart() and ToggleDocking(). In both methods, simply do not invoke the parent class methods.

claude laflamme Mar 28, 2006 - 11:37 AM

Tanks to your reply. It works but not when my control bars are tabulated. It looks like if any CExtControlBar classes are transformed to CExtDynTabControlBar and then my overriden methods aren’t called. What should I do?

Technical Support Mar 29, 2006 - 8:12 AM

The control bar algorithms create tabbed bar container windows dynamically during drag-and-drop or when you load the control bar’s state. The tabbed container is also a resizable control bar. It is a CExtDynTabControlBar window in case of simple control bars. If you want to use your CExtDynTabControlBar-classes, you need ti handle the CExtControlBar::g_nMsgCreateTabbedBar registered windows message in your main frame class:

ON_REGISTERED_MESSAGE( CExtControlBar::g_nMsgCreateTabbedBar, OnMsgCreateTabbedBar )
 
LRESULT CMainFrame::OnMsgCreateTabbedBar( WPARAM wParam, LPARAM )
{
CExtDynTabControlBar ** ppDynTabBar =
        reinterpret_cast < CExtDynTabControlBar ** > ( wParam );
    (*ppDynTabBar) = new C_YOUR_CExtDynTabControlBar_DERIVED_CLASS;
}
Of course, your tabbed bar class may implement any kind of custom layout and/or behavior you need.

In case of dynamic resizable control bars the tabbed container is a CExtDynamicTabbedControlBar class or derived from it and you should not handle the CExtControlBar::g_nMsgCreateTabbedBar registered windows message. Instead, override the CExtDynamicBarSite::OnDbsCreateTabbedBarInstance() virtual method:
CExtDynamicTabbedControlBar * CExtDynamicBarSite::OnDbsCreateTabbedBarInstance() const
{
    ASSERT( this != NULL );
CExtDynamicTabbedControlBar * pBar =
        new C_YOUR_CExtDynamicTabbedControlBar_DERIVED_CLASS;
    return pBar;
}