X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36202885d48e85cc2012f5595ec1dfe00991e886..4b7b750dd1ffd0d26b78728adb613b282a37c058:/src/gtk1/notebook.cpp diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 1bbcc15109..f47bb99b30 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -342,16 +342,6 @@ int wxNotebook::GetSelection() const return m_selection; } -int wxNotebook::GetPageCount() const -{ - return (int) g_list_length( GTK_NOTEBOOK(m_widget)->children ); -} - -int wxNotebook::GetRowCount() const -{ - return 1; -} - wxString wxNotebook::GetPageText( int page ) const { wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid notebook") ); @@ -404,25 +394,6 @@ int wxNotebook::SetSelection( int page ) return selOld; } -void wxNotebook::AdvanceSelection( bool forward ) -{ - wxCHECK_RET( m_widget != NULL, wxT("invalid notebook") ); - - int max = GetPageCount(); - if ( !max ) - { - // nothing to do with empty notebook - return; - } - - int sel = GetSelection(); - - if (forward) - SetSelection( sel == max - 1 ? 0 : sel + 1 ); - else - SetSelection( sel == 0 ? max - 1 : sel - 1 ); -} - void wxNotebook::SetImageList( wxImageList* imageList ) { if (m_ownsImageList) delete m_imageList; @@ -584,11 +555,11 @@ bool wxNotebook::DeletePage( int page ) return TRUE; } -bool wxNotebook::RemovePage( int page ) +wxNotebookPage *wxNotebook::DoRemovePage( int page ) { wxGtkNotebookPage* nb_page = GetNotebookPage(page); - wxCHECK_MSG( nb_page, FALSE, _T("wxNotebook::RemovePage: invalid page") ); + wxCHECK_MSG( nb_page, NULL, _T("wxNotebook::RemovePage: invalid page") ); gtk_widget_ref( nb_page->m_client->m_widget ); gtk_widget_unrealize( nb_page->m_client->m_widget ); @@ -596,9 +567,10 @@ bool wxNotebook::RemovePage( int page ) gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page ); + wxNotebookPage *pageRemoved = (wxNotebookPage *)m_pages[page]; m_pages.DeleteObject( nb_page ); - return TRUE; + return pageRemoved; } bool wxNotebook::InsertPage( int position, wxNotebookPage* win, const wxString& text, @@ -700,17 +672,6 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) event.Skip(); } -wxNotebookPage *wxNotebook::GetPage( int page ) const -{ - wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, wxT("invalid notebook") ); - - wxGtkNotebookPage* nb_page = GetNotebookPage(page); - if (!nb_page) - return (wxNotebookPage *) NULL; - else - return nb_page->m_client; -} - #if wxUSE_CONSTRAINTS // override these 2 functions to do nothing: everything is done in OnSize