Dear Support,
I have fixed this bug, and i think you should review my fix, enhance it, and insert it into the next version/patch.
These are the changes:
1) Added the function
LONG GetItemCount() { return m_wndTabSwitcher.ItemGetCount(); }
To the CExtDynTabControlBar class
2) In the KillBar (which i think should also be a part of the library)
I have added after:
pTabbedBar->RemoveSelFromSwitcher();
these lines:
if (-1==pTabbedBar->GetSwitcherSelection() && pTabbedBar->GetItemCount()>0)
{
pTabbedBar->SetSwitcherSelection(0);
}
3) In CExtDynControlBar::NcButtons_HandleClick i have added a variable
bool bForceBaseCall = false;
4) In CExtDynControlBar::NcButtons_HandleClick after
if( nTabSel >= 0 )
pActiveInTabbedBar = pTabbedBar->GetBarAt( nTabSel, true );
Add
if (pTabbedBar->GetItemCount()<=1)
{
bForceBaseCall = true;
}
5) At the end of CExtDynControlBar::NcButtons_HandleClick
Change
if( ! bRetVal)
to
if( ! bRetVal || bForceBaseCall)
The reason for 3+4+5 is that when it is the last bar in the tab, we need to call the base class that does the closure of the tab.
If you don’t add it, then you have an empty bar left open...
Best Regards,
Ron