fixed AdvanceSelection() wrapping
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -365,13 +365,19 @@ void wxNotebook::AdvanceSelection( bool forward )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid notebook") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid notebook") );
|
||||||
|
|
||||||
int sel = GetSelection();
|
|
||||||
int max = GetPageCount();
|
int max = GetPageCount();
|
||||||
|
if ( !max )
|
||||||
|
{
|
||||||
|
// nothing to do with empty notebook
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sel = GetSelection();
|
||||||
|
|
||||||
if (forward)
|
if (forward)
|
||||||
SetSelection( sel == max ? 0 : sel + 1 );
|
SetSelection( sel == max - 1 ? 0 : sel + 1 );
|
||||||
else
|
else
|
||||||
SetSelection( sel == 0 ? max-1 : sel - 1 );
|
SetSelection( sel == 0 ? max - 1 : sel - 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNotebook::SetImageList( wxImageList* imageList )
|
void wxNotebook::SetImageList( wxImageList* imageList )
|
||||||
|
@@ -365,13 +365,19 @@ void wxNotebook::AdvanceSelection( bool forward )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid notebook") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid notebook") );
|
||||||
|
|
||||||
int sel = GetSelection();
|
|
||||||
int max = GetPageCount();
|
int max = GetPageCount();
|
||||||
|
if ( !max )
|
||||||
|
{
|
||||||
|
// nothing to do with empty notebook
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sel = GetSelection();
|
||||||
|
|
||||||
if (forward)
|
if (forward)
|
||||||
SetSelection( sel == max ? 0 : sel + 1 );
|
SetSelection( sel == max - 1 ? 0 : sel + 1 );
|
||||||
else
|
else
|
||||||
SetSelection( sel == 0 ? max-1 : sel - 1 );
|
SetSelection( sel == 0 ? max - 1 : sel - 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNotebook::SetImageList( wxImageList* imageList )
|
void wxNotebook::SetImageList( wxImageList* imageList )
|
||||||
|
Reference in New Issue
Block a user