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