X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7d15ffcdb92677628179d022977cf16d36a15c84..e9e8b38179b147dd04f5c19af7e56a94342e93a7:/include/wx/persist.h diff --git a/include/wx/persist.h b/include/wx/persist.h index 02c9607c10..68097fbcbe 100644 --- a/include/wx/persist.h +++ b/include/wx/persist.h @@ -161,7 +161,7 @@ private: bool m_doSave, m_doRestore; - DECLARE_NO_COPY_CLASS(wxPersistenceManager) + wxDECLARE_NO_COPY_CLASS(wxPersistenceManager); }; // ---------------------------------------------------------------------------- @@ -218,7 +218,7 @@ protected: private: void * const m_obj; - DECLARE_NO_COPY_CLASS(wxPersistentObject) + wxDECLARE_NO_COPY_CLASS(wxPersistentObject); }; // FIXME-VC6: VC6 has troubles with template methods of DLL-exported classes, @@ -239,5 +239,15 @@ inline bool wxPersistentRegisterAndRestore(T *obj) } +// A helper function which also sets the name for the (wxWindow-derived) object +// before registering and restoring it. +template +inline bool wxPersistentRegisterAndRestore(T *obj, const wxString& name) +{ + obj->SetName(name); + + return wxPersistentRegisterAndRestore(obj); +} + #endif // _WX_PERSIST_H_