diff --git a/include/wx/choicebk.h b/include/wx/choicebk.h index f32e8d3a0d..aca809932d 100644 --- a/include/wx/choicebk.h +++ b/include/wx/choicebk.h @@ -86,8 +86,7 @@ protected: void UpdateSelectedPage(size_t newsel) wxOVERRIDE { - m_selection = static_cast(newsel); - GetChoiceCtrl()->Select(m_selection); + GetChoiceCtrl()->Select(newsel); } wxBookCtrlEvent* CreatePageChangingEvent() const wxOVERRIDE; diff --git a/include/wx/simplebook.h b/include/wx/simplebook.h index 7e819700fc..fa859d3044 100644 --- a/include/wx/simplebook.h +++ b/include/wx/simplebook.h @@ -155,9 +155,10 @@ public: } protected: - virtual void UpdateSelectedPage(size_t newsel) wxOVERRIDE + virtual void UpdateSelectedPage(size_t WXUNUSED(newsel)) wxOVERRIDE { - m_selection = (int)newsel; + // Nothing to do here, but must be overridden to avoid the assert in + // the base class version. } virtual wxBookCtrlEvent* CreatePageChangingEvent() const wxOVERRIDE diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index 969ae07a70..e027fd9052 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -500,6 +500,7 @@ int wxBookCtrlBase::DoSetSelection(size_t n, int flags) DoShowPage(page, true); // change selection now to ignore the selection change event + m_selection = n; UpdateSelectedPage(n); if ( flags & SetSelection_SendEvent ) diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index a7f9229d5e..93084375a1 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -293,7 +293,6 @@ void wxListbook::SetImageList(wxImageList *imageList) void wxListbook::UpdateSelectedPage(size_t newsel) { - m_selection = newsel; GetListView()->Select(newsel); GetListView()->Focus(newsel); } diff --git a/src/generic/toolbkg.cpp b/src/generic/toolbkg.cpp index 40ea3a99c2..07cd9fa962 100644 --- a/src/generic/toolbkg.cpp +++ b/src/generic/toolbkg.cpp @@ -197,7 +197,6 @@ void wxToolbook::MakeChangedEvent(wxBookCtrlEvent &event) void wxToolbook::UpdateSelectedPage(size_t newsel) { - m_selection = newsel; GetToolBar()->ToggleTool(newsel + 1, true); }