]>
Commit | Line | Data |
---|---|---|
3972fb49 JS |
1 | \section{\class{wxNotebookEvent}}\label{wxnotebookevent} |
2 | ||
4d0f3cd6 VZ |
3 | This class represents the events generated by a notebook control: currently, |
4 | there are two of them. The PAGE\_CHANGING event is sent before the current | |
3980000c | 5 | page is changed. It allows the program to examine the current page (which |
4d0f3cd6 | 6 | can be retrieved with |
8771a323 | 7 | \helpref{GetOldSelection()}{wxnotebookeventgetoldselection}) and to veto the page |
4d0f3cd6 VZ |
8 | change by calling \helpref{Veto()}{wxnotifyeventveto} if, for example, the |
9 | current values in the controls of the old page are invalid. | |
10 | ||
11 | The second event - PAGE\_CHANGED - is sent after the page has been changed and | |
12 | the program cannot veto it any more, it just informs it about the page change. | |
13 | ||
14 | To summarize, if the program is interested in validating the page values | |
15 | before allowing the user to change it, it should process the PAGE\_CHANGING | |
16 | event, otherwise PAGE\_CHANGED is probably enough. In any case, it is probably | |
17 | unnecessary to process both events at once. | |
3972fb49 JS |
18 | |
19 | \wxheading{Derived from} | |
20 | ||
4d0f3cd6 | 21 | \helpref{wxNotifyEvent}{wxnotifyevent}\\ |
3972fb49 JS |
22 | \helpref{wxCommandEvent}{wxcommandevent}\\ |
23 | \helpref{wxEvent}{wxevent}\\ | |
3972fb49 JS |
24 | \helpref{wxObject}{wxobject} |
25 | ||
954b8ae6 JS |
26 | \wxheading{Include files} |
27 | ||
28 | <wx/notebook.h> | |
29 | ||
a7af285d VZ |
30 | \wxheading{Library} |
31 | ||
32 | \helpref{wxCore}{librarieslist} | |
33 | ||
1d2bd847 | 34 | \input noteevt.inc |
3972fb49 JS |
35 | |
36 | \wxheading{See also} | |
37 | ||
f05074ad | 38 | \helpref{wxNotebook}{wxnotebook} |
3972fb49 JS |
39 | |
40 | \latexignore{\rtfignore{\wxheading{Members}}} | |
41 | ||
de9815cb | 42 | |
3972fb49 JS |
43 | \membersection{wxNotebookEvent::wxNotebookEvent}\label{wxnotebookeventconstr} |
44 | ||
45 | \func{}{wxNotebookEvent}{\param{wxEventType}{ eventType = wxEVT\_NULL}, | |
f0125ede | 46 | \param{int}{ id = 0}, \param{int}{ sel = $-1$}, \param{int}{ oldSel = $-1$}} |
3972fb49 | 47 | |
fc2171bd | 48 | Constructor (used internally by wxWidgets only). |
3972fb49 | 49 | |
de9815cb | 50 | |
3972fb49 JS |
51 | \membersection{wxNotebookEvent::GetOldSelection}\label{wxnotebookeventgetoldselection} |
52 | ||
53 | \constfunc{int}{GetOldSelection}{\void} | |
54 | ||
f0125ede | 55 | Returns the page that was selected before the change, $-1$ if none was selected. |
3972fb49 | 56 | |
de9815cb | 57 | |
3972fb49 JS |
58 | \membersection{wxNotebookEvent::GetSelection}\label{wxnotebookeventgetselection} |
59 | ||
60 | \constfunc{int}{GetSelection}{\void} | |
61 | ||
f0125ede VZ |
62 | Returns the currently selected page, or $-1$ if none was selected. |
63 | ||
64 | {\bf NB:} under Windows, GetSelection() will return the same value as\rtfsp | |
65 | \helpref{GetOldSelection()}{wxnotebookeventgetoldselection} when called from | |
66 | {\tt EVT\_NOTEBOOK\_PAGE\_CHANGING} handler and not the page which is going to | |
de9815cb VZ |
67 | be selected. Also note that the values of selection and old selection returned |
68 | for an event generated in response to a call to | |
69 | \helpref{wxNotebook::SetSelection}{wxnotebooksetselection} shouldn't be trusted | |
70 | as they are currently inconsistent under different platforms (but in this case | |
71 | you presumably don't need them anyhow as you already have the corresponding | |
72 | information). | |
73 | ||
3972fb49 JS |
74 | |
75 | \membersection{wxNotebookEvent::SetOldSelection}\label{wxnotebookeventsetoldselection} | |
76 | ||
77 | \func{void}{SetOldSelection}{\param{int}{ page}} | |
78 | ||
79 | Sets the id of the page selected before the change. | |
80 | ||
de9815cb | 81 | |
3972fb49 JS |
82 | \membersection{wxNotebookEvent::SetSelection}\label{wxnotebookeventsetselection} |
83 | ||
84 | \func{void}{SetSelection}{\param{int}{ page}} | |
85 | ||
86 | Sets the selection member variable. | |
87 | ||
88 | \wxheading{See also} | |
89 | ||
90 | \helpref{wxNotebookEvent::GetSelection}{wxnotebookeventgetselection} | |
91 | ||
92 |