diff --git a/include/wx/aui/serializer.h b/include/wx/aui/serializer.h index 1b720d744e..3e8930d91a 100644 --- a/include/wx/aui/serializer.h +++ b/include/wx/aui/serializer.h @@ -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; } diff --git a/interface/wx/aui/serializer.h b/interface/wx/aui/serializer.h index 896313fcc5..fb3f855dc0 100644 --- a/interface/wx/aui/serializer.h +++ b/interface/wx/aui/serializer.h @@ -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(). diff --git a/samples/aui/auidemo.cpp b/samples/aui/auidemo.cpp index 1a4d0792d8..fd5b4794df 100644 --- a/samples/aui/auidemo.cpp +++ b/samples/aui/auidemo.cpp @@ -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;