Enhance side panels behaviour: close a single panel instead of the entire stack

Close #8471, close #8753
This commit is contained in:
Udo Hoffmann 2020-08-23 12:21:26 +02:00 committed by Don HO
parent 00d75495c9
commit d9959c1a7c
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -1136,33 +1136,25 @@ void DockingCont::onSize()
void DockingCont::doClose() void DockingCont::doClose()
{ {
int iItemOff = 0;
int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0)); int iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
int iItemCur = getActiveTb();
for (int iItem = 0; iItem < iItemCnt; ++iItem)
{
TCITEM tcItem = {0}; TCITEM tcItem = {0};
// get item data
selectTab(iItemOff);
tcItem.mask = TCIF_PARAM; tcItem.mask = TCIF_PARAM;
::SendMessage(_hContTab, TCM_GETITEM, iItemOff, reinterpret_cast<LPARAM>(&tcItem)); ::SendMessage(_hContTab, TCM_GETITEM, iItemCur, reinterpret_cast<LPARAM>(&tcItem));
if (!tcItem.lParam) if (tcItem.lParam)
continue; {
// notify child windows // notify child windows
if (NotifyParent(DMM_CLOSE) == 0) if (NotifyParent(DMM_CLOSE) == 0)
{ {
// delete tab // delete tab
hideToolbar((tTbData*)tcItem.lParam); hideToolbar((tTbData*)tcItem.lParam);
} }
else
{
++iItemOff;
}
} }
if (iItemOff == 0) iItemCnt = static_cast<int32_t>(::SendMessage(_hContTab, TCM_GETITEMCOUNT, 0, 0));
if (iItemCnt == 0)
{ {
// hide dialog first // hide dialog first
this->doDialog(false); this->doDialog(false);