X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bd448041e742f66b43c74bfddd2dfbda8680394a..e1efca652844273c3e8d32c7e5f442b87e455ca7:/samples/notebook/notebook.cpp diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 7e1a3e025b..3aceabbe2f 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -972,6 +972,12 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event) nameControl, veto; const wxEventType eventType = event.GetEventType(); + + // NB: can't use wxStaticCast here as wxBookCtrlBase is not in + // wxRTTI + const wxBookCtrlBase * const + book = static_cast(event.GetEventObject()); + for ( size_t n = 0; n < WXSIZEOF(events); n++ ) { const EventInfo& ei = events[n]; @@ -983,10 +989,6 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event) { const int idx = event.GetOldSelection(); - // NB: can't use wxStaticCast here as wxBookCtrlBase is not in - // wxRTTI - const wxBookCtrlBase * const - book = static_cast(event.GetEventObject()); if ( idx != wxNOT_FOUND && book && book->GetPageText(idx) == VETO_PAGE_NAME ) { @@ -1017,13 +1019,14 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event) static int s_num = 0; - wxLogMessage(wxT("Event #%d: %s: %s (%d) new sel %d, old %d%s"), + wxLogMessage(wxT("Event #%d: %s: %s (%d) new sel %d, old %d, current %d%s"), ++s_num, nameControl.c_str(), nameEvent.c_str(), eventType, event.GetSelection(), event.GetOldSelection(), + book->GetSelection(), veto.c_str()); #if USE_LOG