// wxListbook creation
// ----------------------------------------------------------------------------
-void wxListbook::Init()
-{
- m_selection = wxNOT_FOUND;
-}
-
bool
wxListbook::Create(wxWindow *parent,
wxWindowID id,
GetListView()->Focus(newsel);
}
-int wxListbook::GetSelection() const
-{
- return m_selection;
-}
-
wxBookCtrlEvent* wxListbook::CreatePageChangingEvent() const
{
return new wxBookCtrlEvent(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, m_windowId);
GetListView()->Focus(m_selection);
}
- // some page should be selected: either this one or the first one if there
- // is still no selection
- int selNew = -1;
- if ( bSelect )
- selNew = n;
- else if ( m_selection == -1 )
- selNew = 0;
-
- if ( selNew != m_selection )
+ if ( !DoSetSelectionAfterInsertion(n, bSelect) )
page->Hide();
- if ( selNew != -1 )
- SetSelection(selNew);
-
UpdateSize();
return true;
int sel = m_selection - 1;
if (page_count == 1)
sel = wxNOT_FOUND;
- else if ((page_count == 2) || (sel == -1))
+ else if ((page_count == 2) || (sel == wxNOT_FOUND))
sel = 0;
// force sel invalid if deleting current page - don't try to hide it
if (!wxBookCtrlBase::DeleteAllPages())
return false;
- m_selection = -1;
-
UpdateSize();
return true;