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