]>
Commit | Line | Data |
---|---|---|
3972fb49 JS |
1 | \section{\class{wxNotebookEvent}}\label{wxnotebookevent} |
2 | ||
4d0f3cd6 VZ |
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 | |
8771a323 | 7 | \helpref{GetOldSelection()}{wxnotebookeventgetoldselection}) and to veto the page |
4d0f3cd6 VZ |
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. | |
3972fb49 | 18 | |
eeca623e VZ |
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 | ||
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 | ||
37 | To process a notebook event, use these event handler macros to direct input to member | |
38 | functions 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 | 43 | wxEVT\_COMMAND\_NOTEBOOK\_PAGE\_CHANGED event.} |
2432b92d | 44 | \twocolitem{{\bf EVT\_NOTEBOOK\_PAGE\_CHANGING(id, func)}}{The page selection is about to be changed. |
fd128b0c | 45 | Processes 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 | 59 | Constructor (used internally by wxWindows only). |
3972fb49 JS |
60 | |
61 | \membersection{wxNotebookEvent::GetOldSelection}\label{wxnotebookeventgetoldselection} | |
62 | ||
63 | \constfunc{int}{GetOldSelection}{\void} | |
64 | ||
65 | Returns 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 | ||
71 | Returns 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 | ||
77 | Sets 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 | ||
83 | Sets the selection member variable. | |
84 | ||
85 | \wxheading{See also} | |
86 | ||
87 | \helpref{wxNotebookEvent::GetSelection}{wxnotebookeventgetselection} | |
88 | ||
89 |