]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/noteevt.tex
Small changes
[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
7\helpref{GetOldSelection()}wxnotebookeventgetoldselection}) and to veto the page
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 18
eeca623e
VZ
19{\bf NB:} under Windows, GetSelection() will return the same value as
20GetOldSelection() when called from PAGE\_CHANGING handler and not the page
21which is going to be selected if the handler doesn't call Veto().
22
3972fb49
JS
23\wxheading{Derived from}
24
4d0f3cd6 25\helpref{wxNotifyEvent}{wxnotifyevent}\\
3972fb49
JS
26\helpref{wxCommandEvent}{wxcommandevent}\\
27\helpref{wxEvent}{wxevent}\\
28\helpref{wxEvtHandler}{wxevthandler}\\
29\helpref{wxObject}{wxobject}
30
954b8ae6
JS
31\wxheading{Include files}
32
33<wx/notebook.h>
34
3972fb49
JS
35\wxheading{Event table macros}
36
37To process a notebook event, use these event handler macros to direct input to member
38functions that take a wxNotebookEvent argument.
39
40\twocolwidtha{7cm}
41\begin{twocollist}\itemsep=0pt
2432b92d 42\twocolitem{{\bf EVT\_NOTEBOOK\_PAGE\_CHANGED(id, func)}}{The page selection was changed. Processes a
3972fb49 43wxEVT\_COMMAND\_NOTEBOOK\_PAGE\_CHANGED event.}
2432b92d 44\twocolitem{{\bf EVT\_NOTEBOOK\_PAGE\_CHANGING(id, func)}}{The page selection is about to be changed.
fd128b0c 45Processes a wxEVT\_COMMAND\_NOTEBOOK\_PAGE\_CHANGING event. This event can be \helpref{vetoed}{wxnotifyeventveto}.}
3972fb49
JS
46\end{twocollist}%
47
48\wxheading{See also}
49
50\helpref{wxNotebook}{wxnotebook}, \helpref{wxTabCtrl}{wxtabctrl}, \helpref{wxTabEvent}{wxtabevent}
51
52\latexignore{\rtfignore{\wxheading{Members}}}
53
54\membersection{wxNotebookEvent::wxNotebookEvent}\label{wxnotebookeventconstr}
55
56\func{}{wxNotebookEvent}{\param{wxEventType}{ eventType = wxEVT\_NULL},
57 \param{int}{ id = 0}, \param{int}{ sel = -1}, \param{int}{ oldSel = -1}}
58
4d0f3cd6 59Constructor (used internally by wxWindows only).
3972fb49
JS
60
61\membersection{wxNotebookEvent::GetOldSelection}\label{wxnotebookeventgetoldselection}
62
63\constfunc{int}{GetOldSelection}{\void}
64
65Returns the page that was selected before the change, -1 if none was selected.
66
67\membersection{wxNotebookEvent::GetSelection}\label{wxnotebookeventgetselection}
68
69\constfunc{int}{GetSelection}{\void}
70
71Returns the currently selected page, or -1 if none was selected.
72
73\membersection{wxNotebookEvent::SetOldSelection}\label{wxnotebookeventsetoldselection}
74
75\func{void}{SetOldSelection}{\param{int}{ page}}
76
77Sets the id of the page selected before the change.
78
79\membersection{wxNotebookEvent::SetSelection}\label{wxnotebookeventsetselection}
80
81\func{void}{SetSelection}{\param{int}{ page}}
82
83Sets the selection member variable.
84
85\wxheading{See also}
86
87\helpref{wxNotebookEvent::GetSelection}{wxnotebookeventgetselection}
88
89