mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-27 10:44:21 +08:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user