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 » CExtControlBar with icon Collapse All
Subject Author Date
Marcos Siqueira Jul 30, 2005 - 11:18 PM

Hi,


I want to create ControlBars with an icon on left, i followed the example found in Prof-UIS Help, its works fine but when i put these bars docked in tabbed mode, i mean using DockControlBarIntoTabbedContainer, the icon is not painted but because the number of NCButtons still the same, a new button [\/] appears on right, so how can i solve this problem ?


 


Thanks in advance

Technical Support Jul 31, 2005 - 10:45 AM

The tabbed bar group is also a kind of resizable control bar which is implemented in the CExtDynTabControlBar class. This class is created by Prof-UIS when the user drag-and-drops control bars into tabbed groups, loads the state of control bars in tabbed groups from the registry or your code invokes the CExtControlBar::DockControlBarIntoTabbedContainer() method. The CExtDynTabControlBar class is derived from the CExtControlBar class and has its own set of buttons. You can create a CExtDynTabControlBar-derived class and implement all your custom buttons in it as you already did this in your CExtControlBar-derived class. To use your tabbed bar in the library, you need to handle the CExtControlBar::g_nMsgCreateTabbedBar registered windows message in the main frame window like as follows:

ON_REGISTERED_MESSAGE(
    CExtControlBar::g_nMsgCreateTabbedBar,
    OnMsgCreateTabbedBar
    )
 
LRESULT OnMsgCreateTabbedBar(
    WPARAM wParam,
    LPARAM lParam
    )
{
    lParam; // unused parameter
CExtDynTabControlBar ** ppBar =
        (CExtDynTabControlBar **)wParam;
    ASSERT( ppBar != NULL );
    (*ppBar) = new C_YOUR_DynTabControlBar;
    return 0;
}
If you use dynamic resizable control bars (the CExtDynamicControlBar class) managed by the dynamic bar site (the CExtDynamicBarSite class, which is typically a base class of your main frame), then you should not implement the message handler method for the CExtControlBar::g_nMsgCreateTabbedBar registered windows message. Just override the CExtDynamicBarSite::OnDbsCreateTabbedBarInstance() virtual method instead:
CExtDynamicTabbedControlBar *
    CMainFrame::OnDbsCreateTabbedBarInstance() const
{
CExtDynamicTabbedControlBar * pBar =
        new C_YOUR_DynTabControlBar;
    return pBar;
}
The CExtDynamicTabbedControlBar class is derived from CExtDynTabControlBar and should be used as abase class of your C_YOUR_DynTabControlBar class in case of dynamic resizable control bars.