]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/noteevt.tex
minor updates/clarifications to the wxNotebook docs
[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
5page is changed. It allows to the program to examine the current page (which
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}\\
24\helpref{wxEvtHandler}{wxevthandler}\\
25\helpref{wxObject}{wxobject}
26
954b8ae6
JS
27\wxheading{Include files}
28
29<wx/notebook.h>
30
1d2bd847 31\input noteevt.inc
3972fb49
JS
32
33\wxheading{See also}
34
35\helpref{wxNotebook}{wxnotebook}, \helpref{wxTabCtrl}{wxtabctrl}, \helpref{wxTabEvent}{wxtabevent}
36
37\latexignore{\rtfignore{\wxheading{Members}}}
38
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
4d0f3cd6 44Constructor (used internally by wxWindows only).
3972fb49
JS
45
46\membersection{wxNotebookEvent::GetOldSelection}\label{wxnotebookeventgetoldselection}
47
48\constfunc{int}{GetOldSelection}{\void}
49
f0125ede 50Returns the page that was selected before the change, $-1$ if none was selected.
3972fb49
JS
51
52\membersection{wxNotebookEvent::GetSelection}\label{wxnotebookeventgetselection}
53
54\constfunc{int}{GetSelection}{\void}
55
f0125ede
VZ
56Returns the currently selected page, or $-1$ if none was selected.
57
58{\bf NB:} under Windows, GetSelection() will return the same value as\rtfsp
59\helpref{GetOldSelection()}{wxnotebookeventgetoldselection} when called from
60{\tt EVT\_NOTEBOOK\_PAGE\_CHANGING} handler and not the page which is going to
61be selected.
3972fb49
JS
62
63\membersection{wxNotebookEvent::SetOldSelection}\label{wxnotebookeventsetoldselection}
64
65\func{void}{SetOldSelection}{\param{int}{ page}}
66
67Sets the id of the page selected before the change.
68
69\membersection{wxNotebookEvent::SetSelection}\label{wxnotebookeventsetselection}
70
71\func{void}{SetSelection}{\param{int}{ page}}
72
73Sets the selection member variable.
74
75\wxheading{See also}
76
77\helpref{wxNotebookEvent::GetSelection}{wxnotebookeventgetselection}
78
79