Allow wxAuiDeserializer::CreatePaneWindow() to modify pane info

wxAuiPaneInfo fields such as "caption" or "icon" wouldn't normally be
serialized and so CreatePaneWindow() should be allowed to fill them in.
This commit is contained in:
Vadim Zeitlin
2024-12-03 18:02:56 +01:00
parent a13020d2df
commit 95b8abe3fe
3 changed files with 12 additions and 3 deletions
+5 -1
View File
@@ -89,7 +89,11 @@ public:
// layout and allows to create windows on the fly.
//
// If this function returns nullptr, the pane is not added to the manager.
virtual wxWindow* CreatePaneWindow(const wxAuiPaneInfo& WXUNUSED(pane))
//
// Note that the pane may (and usually will, if a window is created) be
// modified, to set fields such as caption or icon that wouldn't normally
// be serialized.
virtual wxWindow* CreatePaneWindow(wxAuiPaneInfo& WXUNUSED(pane))
{
return nullptr;
}
+6 -1
View File
@@ -175,8 +175,13 @@ public:
If this function returns @NULL, as it does by default, the pane is not
added to the manager.
If the function does create a new window, it should typically modify @a
pane parameter to fill in the fields such as `caption` or `icon` that
wouldn't normally be serialized and so wouldn't be restored by
LoadPanes().
*/
virtual wxWindow* CreatePaneWindow(const wxAuiPaneInfo& pane);
virtual wxWindow* CreatePaneWindow(wxAuiPaneInfo& pane);
/**
Load information about all the docks previously saved with SaveDock().
+1 -1
View File
@@ -1724,7 +1724,7 @@ public:
return panes;
}
virtual wxWindow* CreatePaneWindow(const wxAuiPaneInfo& pane) override
virtual wxWindow* CreatePaneWindow(wxAuiPaneInfo& pane) override
{
wxLogWarning("Unknown pane \"%s\"", pane.name);
return nullptr;