// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
-// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
wxNotebookPage* page = m_pages[nPage] ;
m_pages.RemoveAt(nPage);
+ m_images.RemoveAt(nPage);
MacSetupTabs();
- if (m_selection >= (int)GetPageCount())
- m_selection = GetPageCount() - 1;
+ if ( m_selection >= (int)nPage )
+ {
+ if ( GetPageCount() == 0 )
+ m_selection = wxNOT_FOUND;
+ else
+ m_selection = m_selection ? m_selection - 1 : 0;
+
+ GetPeer()->SetValue( m_selection + 1 ) ;
+ }
if (m_selection >= 0)
m_pages[m_selection]->Show(true);
// remove all pages
bool wxNotebook::DeleteAllPages()
{
- WX_CLEAR_ARRAY(m_pages) ;
+ WX_CLEAR_ARRAY(m_pages);
+ m_images.clear();
MacSetupTabs();
m_selection = wxNOT_FOUND ;
InvalidateBestSize();