wxWidgets/interface/wx/persist/window.h
Vadim Zeitlin 3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00

51 lines
2.0 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/persist/window.h
// Purpose: interface of wxPersistentWindow<>
// Author: Vadim Zeitlin
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
Base class for persistent windows.
Compared to wxPersistentObject this class does three things:
- Most importantly, wxPersistentWindow catches wxWindowDestroyEvent
generated when the window is destroyed and saves its properties
automatically when it happens.
- It implements GetName() using wxWindow::GetName() so that the derived
classes don't need to do it.
- It adds a convenient wxPersistentWindow::Get() accessor returning the
window object of the correct type.
*/
template <class T>
class wxPersistentWindow : public wxPersistentObject
{
public:
/// The type of the associated window.
typedef T WindowType;
/**
Constructor for a persistent window object.
The constructor uses wxEvtHandler::Connect() to catch
wxWindowDestroyEvent generated when the window is destroyed and call
wxPersistenceManager::SaveAndUnregister() when this happens. This
ensures that the window properties are saved and that this object
itself is deleted when the window is.
*/
wxPersistentWindow(WindowType *win);
WindowType *Get() const { return static_cast<WindowType *>(GetWindow()); }
/**
Implements the base class pure virtual method using wxWindow::GetName().
Notice that window names are usually not unique while this function
must return a unique (at least among the objects of this type) string.
Because of this you need to specify a non-default window name in its
constructor when creating it or explicitly call wxWindow::SetName()
before saving or restoring persistent properties.
*/
virtual wxString GetName() const;
};