X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8864388cf203f3238d45f283676744f624304c71..ddd7e4307b4a58a21e8a5eb04afe06e1fe65f7d8:/samples/notebook/notebook.cpp diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index b56dbaeb9f..3aceabbe2f 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -548,7 +548,8 @@ void MyFrame::RecreateBook() m_bookCtrl->Hide(); - if ( m_chkShowImages ) + // wxToolbook doesn't work without icons so always use them for it. + if ( m_chkShowImages || m_type == Type_Toolbook ) { m_bookCtrl->SetImageList(m_imageList); } @@ -971,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]; @@ -982,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 ) { @@ -1016,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