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 » CExtDynamicControlBar undocking notification? Collapse All
Subject Author Date
Andrew Harding Apr 21, 2006 - 9:30 AM

My application uses CExtDynamicControlBars, some of which are using the docking style while others are using the tabbed document style. I would like to be able to detect when the tab control contains no more tabs due to the user either hiding the docking bars that it contained or because they changed them to docking or floating windows instead. The most obvious way would be to subclass CExtTabPageContainerOneNoteWnd and override the PageInsert and PageRemove methods so that they sent a message to me indicating that they were called. This idea was thwarted however due to the fact that CExtTabPageContainerOneNoteWnd and it’s parents functions are all non-virtual.

Is there a reason for these functions to be non-virtual? Is there another way that I can recieve notification that a docking window was added / removed to / from the tab control?

Technical Support Apr 22, 2006 - 10:50 AM

All the tab page container classes are similar to each other. They just use different kinds of tab windows. The instance of the tab control used by the tab page container window is created by the CExtTabPageContainerWnd::OnTabWndGetTabImpl() method. Here is how this method is implemented in the CExtTabPageContainerOneNoteWnd class:

virtual CExtTabWnd * OnTabWndGetTabImpl()
{
    return new CExtTWPC < CExtTabOneNoteWnd >;
}
You can use your CExtTabPageContainerOneNoteWnd-derived class with your custom tab control:
class CYourCustomOneNoteTabs : public CExtTWPC < CExtTabOneNoteWnd >
{
    virtual void OnTabWndItemInsert(
        LONG nItemIndex,
        TAB_ITEM_INFO * pTii
        );
    virtual void OnTabWndRemoveItem(
        LONG nItemIndex,
        LONG nCount,
        bool bPreRemove
        );
    virtual void OnTabWndRemoveAllItems(
        bool bPreRemove
        );
};
 
class CYourOneNoteTabPageContainerWnd : public CExtTabPageContainerOneNoteWnd
{
    virtual CExtTabWnd * OnTabWndGetTabImpl()
    {
        return new CYourCustomOneNoteTabs;
    }
};
Your implementation of the OnTabWndItemInsert(), OnTabWndRemoveItem() and OnTabWndRemoveAllItems() methods in the CYourCustomOneNoteTabs class should invoke the parent method first and then analyze the number of items in the CExtTabWnd control for further specific actions in your application.