Add wxBookCtrlBase::DoSetSelectionAfterRemoval() and use it in wxSimplebook.
This fixes the wrong handling of the selection in wxSimplebook when the currently selected page was deleted. Also extend the unit tests to check for this bug. Closes #15188. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -156,8 +156,15 @@ protected:
|
||||
|
||||
virtual wxWindow *DoRemovePage(size_t page)
|
||||
{
|
||||
m_pageTexts.erase(m_pageTexts.begin() + page);
|
||||
return wxBookCtrlBase::DoRemovePage(page);
|
||||
wxWindow* const win = wxBookCtrlBase::DoRemovePage(page);
|
||||
if ( win )
|
||||
{
|
||||
m_pageTexts.erase(m_pageTexts.begin() + page);
|
||||
|
||||
DoSetSelectionAfterRemoval(page);
|
||||
}
|
||||
|
||||
return win;
|
||||
}
|
||||
|
||||
virtual void DoSize()
|
||||
|
Reference in New Issue
Block a user