]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/noteevt.tex
Applied patch [ 589484 ] wxGenericListCtrl, fix for direct use.
[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}\\
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
34\helpref{wxNotebook}{wxnotebook}, \helpref{wxTabCtrl}{wxtabctrl}, \helpref{wxTabEvent}{wxtabevent}
35
36\latexignore{\rtfignore{\wxheading{Members}}}
37
38\membersection{wxNotebookEvent::wxNotebookEvent}\label{wxnotebookeventconstr}
39
40\func{}{wxNotebookEvent}{\param{wxEventType}{ eventType = wxEVT\_NULL},
f0125ede 41 \param{int}{ id = 0}, \param{int}{ sel = $-1$}, \param{int}{ oldSel = $-1$}}
3972fb49 42
4d0f3cd6 43Constructor (used internally by wxWindows only).
3972fb49
JS
44
45\membersection{wxNotebookEvent::GetOldSelection}\label{wxnotebookeventgetoldselection}
46
47\constfunc{int}{GetOldSelection}{\void}
48
f0125ede 49Returns the page that was selected before the change, $-1$ if none was selected.
3972fb49
JS
50
51\membersection{wxNotebookEvent::GetSelection}\label{wxnotebookeventgetselection}
52
53\constfunc{int}{GetSelection}{\void}
54
f0125ede
VZ
55Returns the currently selected page, or $-1$ if none was selected.
56
57{\bf NB:} under Windows, GetSelection() will return the same value as\rtfsp
58\helpref{GetOldSelection()}{wxnotebookeventgetoldselection} when called from
59{\tt EVT\_NOTEBOOK\_PAGE\_CHANGING} handler and not the page which is going to
60be selected.
3972fb49
JS
61
62\membersection{wxNotebookEvent::SetOldSelection}\label{wxnotebookeventsetoldselection}
63
64\func{void}{SetOldSelection}{\param{int}{ page}}
65
66Sets the id of the page selected before the change.
67
68\membersection{wxNotebookEvent::SetSelection}\label{wxnotebookeventsetselection}
69
70\func{void}{SetSelection}{\param{int}{ page}}
71
72Sets the selection member variable.
73
74\wxheading{See also}
75
76\helpref{wxNotebookEvent::GetSelection}{wxnotebookeventgetselection}
77
78