use a single wxBookCtrlEvent class for all wxBookCtrlBase-derived controls (#9667)
[wxWidgets.git] / interface / wx / bookctrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bookctrl.h
3 // Purpose: interface of wxBookCtrlBase
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxBookCtrlBase
11
12 @todo Document this class.
13
14 @library{wxcore}
15 @category{miscwnd}
16
17 @see @ref overview_bookctrl
18 */
19 class wxBookCtrlBase : public wxControl
20 {
21 public:
22
23 };
24
25
26 /**
27 @class wxBookCtrlEvent
28
29 This class represents the events generated by book controls (wxNotebook,
30 wxListbook, wxChoicebook, wxTreebook).
31 The PAGE_CHANGING events are sent before the current page is changed.
32 It allows the program to examine the current page (which can be retrieved
33 with wxBookCtrlEvent::GetOldSelection) and to veto the page change by calling
34 wxNotifyEvent::Veto if, for example, the current values in the controls
35 of the old page are invalid.
36
37 The PAGE_CHANGED events are sent after the page has been changed and
38 the program cannot veto it any more, it just informs it about the page
39 change.
40
41 To summarize, if the program is interested in validating the page values
42 before allowing the user to change it, it should process the PAGE_CHANGING
43 event, otherwise PAGE_CHANGED is probably enough. In any case, it is
44 probably unnecessary to process both events at once.
45
46 @library{wxcore}
47 @category{events}
48
49 @see wxNotebook, wxListbook, wxChoicebook, wxTreebook
50 */
51
52 class wxBookCtrlEvent : public wxNotifyEvent
53 {
54 public:
55 /**
56 Constructor (used internally by wxWidgets only).
57 */
58 wxBookCtrlEvent(wxEventType eventType = wxEVT_NULL, int id = 0,
59 int sel = wxNOT_FOUND, int oldSel = wxNOT_FOUND);
60
61 /**
62 Returns the page that was selected before the change, @c wxNOT_FOUND if
63 none was selected.
64 */
65 int GetOldSelection() const;
66
67 /**
68 Returns the currently selected page, or @c wxNOT_FOUND if none was
69 selected.
70 @note under Windows, GetSelection() will return the same value as
71 GetOldSelection() when called from @c EVT_NOTEBOOK_PAGE_CHANGING
72 handler and not the page which is going to be selected.
73 */
74 int GetSelection() const;
75
76 /**
77 Sets the id of the page selected before the change.
78 */
79 void SetOldSelection(int page);
80
81 /**
82 Sets the selection member variable.
83 */
84 void SetSelection(int page);
85 };
86