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