bookctrl.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/persist/bookctrl.h
  3. // Purpose: interface of wxPersistentBookCtrl
  4. // Author: Vadim Zeitlin
  5. // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. /**
  9. Persistence adapter for wxBookCtrlBase.
  10. This adapter handles the selected page of wxBookCtrlBase, i.e. it saves its
  11. value when the associated book control is destroyed and restores it when it
  12. is recreated.
  13. @see wxPersistentTreeBookCtrl
  14. */
  15. class wxPersistentBookCtrl : public wxPersistentWindow<wxBookCtrlBase>
  16. {
  17. public:
  18. /**
  19. Constructor.
  20. @param book
  21. The associated book control.
  22. */
  23. wxPersistentBookCtrl(wxBookCtrlBase *book);
  24. /**
  25. Save the currently selected page index.
  26. */
  27. virtual void Save() const;
  28. /**
  29. Restore the selected page index.
  30. The book control must be initialized before calling this function, i.e.
  31. all of its pages should be already added to it -- otherwise restoring
  32. the selection has no effect.
  33. */
  34. virtual bool Restore();
  35. };
  36. /// Overload allowing persistence adapter creation for wxBookCtrlBase-derived
  37. /// objects.
  38. wxPersistentObject *wxCreatePersistentObject(wxBookCtrlBase *book);