X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/acfd422afac254f4356904275656c0c15685fa1e..051b55ad8ba1efe5f7c16c430131d4cd1b5fb90e:/src/gtk/notebook.cpp diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index a690de0dea..2eb7a24f51 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -36,6 +36,16 @@ extern bool g_isIdle; extern bool g_blockEventsOnDrag; +//----------------------------------------------------------------------------- +// debug +//----------------------------------------------------------------------------- + +#ifdef __WXDEBUG__ + +extern void debug_focus_in( GtkWidget* widget, const wxChar* name, const wxChar *window ); + +#endif + //----------------------------------------------------------------------------- // wxNotebookPage //----------------------------------------------------------------------------- @@ -114,7 +124,7 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget), static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win ) { if (g_isIdle) wxapp_install_idle_handler(); - + if ((win->m_x == alloc->x) && (win->m_y == alloc->y) && (win->m_width == alloc->width) && @@ -246,6 +256,10 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id, m_widget = gtk_notebook_new(); +#ifdef __WXDEBUG__ + debug_focus_in( m_widget, _T("wxNotebook::m_widget"), name ); +#endif + gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 ); m_idHandler = gtk_signal_connect ( @@ -558,6 +572,18 @@ bool wxNotebook::DeletePage( int page ) m_pages.DeleteObject( nb_page ); + /* adjust the notebook page numbers so that + m_id reflects the current position, Daniel Paull */ + int count = 0; + wxNode *node = m_pages.First(); + wxNotebookPage *pagePtr = (wxNotebookPage *) NULL; + while (node) + { + pagePtr = (wxNotebookPage*)node->Data(); + pagePtr->m_id = count++; + node = node->Next(); + } + return TRUE; }