Save and restore the active tab control page too

It can be useful to preserve the last selected page -- and if the
application doesn't want to do it, it can avoid it by not saving
wxAuiTabLayoutInfo::active.
This commit is contained in:
Vadim Zeitlin
2025-03-16 20:05:51 +01:00
parent 5ab4e9aa32
commit 84438143e6
4 changed files with 59 additions and 15 deletions
+5
View File
@@ -1693,6 +1693,7 @@ public:
AddPagesList(node, "pages", tab.pages);
AddPagesList(node, "pinned", tab.pinned);
AddPagesList(node, "locked", tab.locked);
AddChild(node, "active", tab.active);
m_book->AddChild(node);
}
@@ -2049,6 +2050,10 @@ private:
for ( const auto& s : pageIndices )
tab.locked.push_back(GetInt(s));
}
else if ( child->GetName() == "active" )
{
tab.active = GetInt(child->GetNodeContent());
}
else
{
throw std::runtime_error("Unexpected tab child node name");