The tabbed bar group is an instance of the CExtDynTabControlBar
class (or CExtDynamicTabbedControlBar
if you are using dynamic control bars controlled by the CExtDynamicBarSite
class). What you can do is to change the style of the tab strip window (the CExtDynTabWnd
class) in a CExtDynTabControlBar
-derived class.
1) Handle the CExtControlBar::g_nMsgCreateTabbedBar
registered windows message in your main frame window:
class C_YOUR_DynTabControlBar : public CExtDynTabControlBar
{
. . .
};
ON_REGISTERED_MESSAGE( CExtControlBar::g_nMsgCreateTabbedBar, OnMsgCreateTabbedBar )
LRESULT CMainFrame::OnMsgCreateTabbedBar( WPARAM wParam, LPARAM lParam )
{
lParam;
CExtDynTabControlBar ** ppBar = (CExtDynTabControlBar **)wParam;
(*ppBar) = new C_YOUR_DynTabControlBar;
return 0L;
}
2) In the
C_YOUR_DynTabControlBar
class, handle the
WM_CREATE
message, copy the contents of the
CExtDynTabControlBar::OnCreate()
method and paste it into this handler and change the styles of the
m_wndTabSwitcher
tab window. You should remove
__ETWS_EQUAL_WIDTHS
and optionally add
__ETWS_AUTOHIDE_SCROLL
. You can find description of these and other tab styles in the documentation.
Your code may look like as follows:
int C_YOUR_DynTabControlBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CExtDynTabControlBar::OnCreate(lpCreateStruct) == -1 )
{
ASSERT( FALSE );
return -1;
}
ASSERT( m_pWndDynDocker != NULL );
ASSERT_KINDOF( CExtDockDynTabBar, m_pWndDynDocker );
ASSERT( m_pWndDynDocker->GetSafeHwnd() != NULL );
ASSERT( ::IsWindow(m_pWndDynDocker->GetSafeHwnd()) );
CRect rcTabSwitcher;
GetClientRect( &rcTabSwitcher );
if( rcTabSwitcher.right <= rcTabSwitcher.left )
rcTabSwitcher.right = rcTabSwitcher.left + 10;
rcTabSwitcher.top =
rcTabSwitcher.bottom
- 2
- __EXTTAB_BTN_MIN_DY
;
DWORD dwETWS = __ETWS_AUTOHIDE_SCROLL;
if( CExtControlBar::g_bTabsAtTop )
dwETWS |= __ETWS_ORIENT_TOP;
else
dwETWS |= __ETWS_ORIENT_BOTTOM;
if( ! m_wndTabSwitcher.Create(
this,
rcTabSwitcher,
UINT( IDC_STATIC ),
WS_CHILD | WS_VISIBLE
//| WS_CLIPSIBLINGS | WS_CLIPCHILDREN
,
dwETWS
)
)
{
ASSERT( FALSE );
return -1;
}
return 0;
}
We wish you a Happy New Year too, Brett.