position is always unsigned in InsetPage(), no need to compare it with 0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -660,13 +660,7 @@ bool wxNotebook::InsertPage( size_t position,
|
|||||||
gtk_signal_connect( GTK_OBJECT(win->m_widget), "size_allocate",
|
gtk_signal_connect( GTK_OBJECT(win->m_widget), "size_allocate",
|
||||||
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)win );
|
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)win );
|
||||||
|
|
||||||
#ifndef __VMS
|
gtk_notebook_insert_page( notebook, win->m_widget, nb_page->m_box, position );
|
||||||
// On VMS position is unsigned and thus always positive
|
|
||||||
if (position < 0)
|
|
||||||
gtk_notebook_append_page( notebook, win->m_widget, nb_page->m_box );
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
gtk_notebook_insert_page( notebook, win->m_widget, nb_page->m_box, position );
|
|
||||||
|
|
||||||
nb_page->m_page = (GtkNotebookPage*) g_list_last(notebook->children)->data;
|
nb_page->m_page = (GtkNotebookPage*) g_list_last(notebook->children)->data;
|
||||||
|
|
||||||
@@ -712,13 +706,7 @@ bool wxNotebook::InsertPage( size_t position,
|
|||||||
gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
|
gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
|
||||||
if (select && (m_pagesData.GetCount() > 1))
|
if (select && (m_pagesData.GetCount() > 1))
|
||||||
{
|
{
|
||||||
#ifndef __VMS
|
SetSelection( position );
|
||||||
// On VMS position is unsigned and thus always positive
|
|
||||||
if (position < 0)
|
|
||||||
SetSelection( GetPageCount()-1 );
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
SetSelection( position );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
|
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
|
||||||
|
@@ -660,13 +660,7 @@ bool wxNotebook::InsertPage( size_t position,
|
|||||||
gtk_signal_connect( GTK_OBJECT(win->m_widget), "size_allocate",
|
gtk_signal_connect( GTK_OBJECT(win->m_widget), "size_allocate",
|
||||||
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)win );
|
GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)win );
|
||||||
|
|
||||||
#ifndef __VMS
|
gtk_notebook_insert_page( notebook, win->m_widget, nb_page->m_box, position );
|
||||||
// On VMS position is unsigned and thus always positive
|
|
||||||
if (position < 0)
|
|
||||||
gtk_notebook_append_page( notebook, win->m_widget, nb_page->m_box );
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
gtk_notebook_insert_page( notebook, win->m_widget, nb_page->m_box, position );
|
|
||||||
|
|
||||||
nb_page->m_page = (GtkNotebookPage*) g_list_last(notebook->children)->data;
|
nb_page->m_page = (GtkNotebookPage*) g_list_last(notebook->children)->data;
|
||||||
|
|
||||||
@@ -712,13 +706,7 @@ bool wxNotebook::InsertPage( size_t position,
|
|||||||
gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
|
gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
|
||||||
if (select && (m_pagesData.GetCount() > 1))
|
if (select && (m_pagesData.GetCount() > 1))
|
||||||
{
|
{
|
||||||
#ifndef __VMS
|
SetSelection( position );
|
||||||
// On VMS position is unsigned and thus always positive
|
|
||||||
if (position < 0)
|
|
||||||
SetSelection( GetPageCount()-1 );
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
SetSelection( position );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
|
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
|
||||||
|
Reference in New Issue
Block a user