]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/noteevt.tex
e1c9e7d476478f6e9f553bcf67b1a3e9bcd21c54
[wxWidgets.git] / docs / latex / wx / noteevt.tex
1 \section{\class{wxNotebookEvent}}\label{wxnotebookevent}
2
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
5 page is changed. It allows to the program to examine the current page (which
6 can be retrieved with
7 \helpref{GetOldSelection()}{wxnotebookeventgetoldselection}) and to veto the page
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.
18
19 {\bf NB:} under Windows, GetSelection() will return the same value as
20 GetOldSelection() when called from PAGE\_CHANGING handler and not the page
21 which is going to be selected if the handler doesn't call Veto().
22
23 \wxheading{Derived from}
24
25 \helpref{wxNotifyEvent}{wxnotifyevent}\\
26 \helpref{wxCommandEvent}{wxcommandevent}\\
27 \helpref{wxEvent}{wxevent}\\
28 \helpref{wxEvtHandler}{wxevthandler}\\
29 \helpref{wxObject}{wxobject}
30
31 \wxheading{Include files}
32
33 <wx/notebook.h>
34
35 \input noteevt.inc
36
37 \wxheading{See also}
38
39 \helpref{wxNotebook}{wxnotebook}, \helpref{wxTabCtrl}{wxtabctrl}, \helpref{wxTabEvent}{wxtabevent}
40
41 \latexignore{\rtfignore{\wxheading{Members}}}
42
43 \membersection{wxNotebookEvent::wxNotebookEvent}\label{wxnotebookeventconstr}
44
45 \func{}{wxNotebookEvent}{\param{wxEventType}{ eventType = wxEVT\_NULL},
46 \param{int}{ id = 0}, \param{int}{ sel = -1}, \param{int}{ oldSel = -1}}
47
48 Constructor (used internally by wxWindows only).
49
50 \membersection{wxNotebookEvent::GetOldSelection}\label{wxnotebookeventgetoldselection}
51
52 \constfunc{int}{GetOldSelection}{\void}
53
54 Returns the page that was selected before the change, -1 if none was selected.
55
56 \membersection{wxNotebookEvent::GetSelection}\label{wxnotebookeventgetselection}
57
58 \constfunc{int}{GetSelection}{\void}
59
60 Returns the currently selected page, or -1 if none was selected.
61
62 \membersection{wxNotebookEvent::SetOldSelection}\label{wxnotebookeventsetoldselection}
63
64 \func{void}{SetOldSelection}{\param{int}{ page}}
65
66 Sets 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
72 Sets the selection member variable.
73
74 \wxheading{See also}
75
76 \helpref{wxNotebookEvent::GetSelection}{wxnotebookeventgetselection}
77
78