![]() ![]() ![]() ![]() wxnotebookeventthis class represents the events generated by a notebook control: currently, there are two of them. the page_changing event is sent before the current page is changed. it allows the program to examine the current page (which can be retrieved with getoldselection()) and to veto the page change by calling veto() if, for example, the current values in the controls of the old page are invalid. the second event - page_changed - is sent after the page has been changed and the program cannot veto it any more, it just informs it about the page change. to summarize, if the program is interested in validating the page values before allowing the user to change it, it should process the page_changing event, otherwise page_changed is probably enough. in any case, it is probably unnecessary to process both events at once. derived from
wxnotifyevent include files <wx/notebook.h> event handling to process input from a notebook control, use the following event handler macros to direct input to member functions that take a wxnotebookevent argument.
see also members
wxnotebookevent::wxnotebookevent
wxnotebookevent::wxnotebookeventwxnotebookevent(wxeventtype eventtype = wxevt_null, int id = 0, int sel = -1, int oldsel = -1) constructor (used internally by wxwidgets only).
wxnotebookevent::getoldselectionint getoldselection() const returns the page that was selected before the change, -1 if none was selected.
wxnotebookevent::getselectionint getselection() const returns the currently selected page, or -1 if none was selected. nb: under windows, getselection() will return the same value as getoldselection() when called from evt_notebook_page_changing handler and not the page which is going to be selected. also note that the values of selection and old selection returned for an event generated in response to a call to wxnotebook::setselection shouldn't be trusted as they are currently inconsistent under different platforms (but in this case you presumably don't need them anyhow as you already have the corresponding information).
wxnotebookevent::setoldselectionvoid setoldselection(int page) sets the id of the page selected before the change.
wxnotebookevent::setselectionvoid setselection(int page) sets the selection member variable. see also
|